Part Number Hot Search : 
IRFRC20 B716A 120UF FX949 FFCR55H2 SI210706 6128AE C1061
Product Description
Full Text Search
 

To Download TMP93CS44 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 TOSHIBA Original CMOS 16-Bit Microcontroller
TLCS-900/L Series
TMP93CS44/S45
Semiconductor Company
Preface
Thank you very much for making use of Toshiba microcomputer LSIs. Before use this LSI, refer the section, "Points of Note and Restrictions". Especially, take care below cautions.
**CAUTION** How to release the HALT mode Usually, interrupts can release all halts status. However, the interrupts = (NMI , INT0), which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (RUN and IDLE2 are not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, halt status can be released without difficultly. The priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
TMP93CS44/S45
Low Voltage/Low Power
CMOS 16-bit Microcontrollers
TMP93CS44F/TMP93CS45F 1. Outline and Device Characteristics
The TMP93CS44/TMP93CS45 are high-speed, advanced 16-bit microcontrollers developed for controlling medium to large-scale equipment. The TMP93CS45 does not have a ROM, the TMP93CS44 has a built-in ROM. Otherwise, the devices function in the same way. The TMP93CS44F/TMP93CS45F are housed in 80-pin flat package (P-LQFP80-1212-0.50E). The device characteristics are as follows: (1) Original 16-bit CPU (900/L CPU) * * * * * TLCS-90 instruction mnemonic upward compatible 16-Mbyte linear address space General-purpose registers and register bank system 16-bit multiplication/division and bit transfer/arithmetic instructions Micro DMA: 4 channels (1.6 s per 2 bytes at 20 MHz)
(2) Minimum instruction execution time: 200 ns at 20 MHz (3) Internal RAM: 2 Kbytes Internal ROM: TMP93CS44
TMP93CS45
64-Kbyte ROM None
(4) External memory expansion * * * Can be expanded up to 16 Mbytes (for both programs and data) AM8/ 16 pin (Select the external data bus width) Can mix 8- and 16-bit external data buses (Dynamic bus sizing)
(5) 8-bit timer: 4 channels (6) 16-bit timer: 2 channels
030619EBP1
* The information contained herein is subject to change without notice. * The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of TOSHIBA or others. * TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the "Handling Guide for Semiconductor Devices," or "TOSHIBA Semiconductor Reliability Handbook" etc.. * The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury ("Unintended Usage"). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc.. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's own risk. * The products described in this document are subject to the foreign exchange and foreign trade laws. * TOSHIBA products should not be embedded to the downstream products which are prohibited to be produced and sold, under any law and regulations. * For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and Reliability Assurance/Handling Precautions.
Purchase of TOSHIBA I2C components conveys a license under the Philips I2C Patent Rights to use these components in an I2C system, provided that the system conforms to the I2C Standard Specification as defined by Philips.
93CS44-1
2004-02-10
TMP93CS44/S45
(7) Serial interface: 2 channels (8) Serial bus interface: 1 channel * * I2C bus mode Clocked-synchronous 8-bit serial interface mode
(9) 10-bit AD converter: 8 channels (10) High current output: 8 ports (11) Watchdog timer (12) Bus width/wait controller: 3 blocks (13) Interrupt functions: 33 * * * 9 CPU interrupts 17 internal interrupts 7 external interrupts 7-level priority can be set (except NMI and INTWD)
(14) I/O ports
TMP93CS44 TMP93CS45 62 pins 44 pins
(15) Standby function: 4 HALT modes (RUN, IDLE2, IDLE1, STOP) (16) Clock gear function * * * Dual clock operation High-frequency clock can be changed from fc to fc/16 VCC = 2.7 to 5.5 V
(17) Wide range of operating voltage
(18) Package Type Number
TMP93CS44F TMP93CS45F
Package
P-LQFP80-1212-0.50E
93CS44-2
2004-02-10
TMP93CS44/S45
AN0 to AN2 (P50 to P52) AN3/ ADTRG (P53) AN4 to AN7 (P54 to P57) AVCC AVSS VREFH VREFL
900/L CPU 10-bit 8-ch AD converter XWA XBC XDE XHL XIX XIY XIZ XSP WA BC DE HL IX IY IZ SP 32-bits F SR PC Highfrequency OSC
VCC [2] VSS [2] X1 X2 CLK Lowfrequency OSC XT1 (P66) XT2 (P67) AM8/ AM16
EA RESET
TXD0 (P60) RXD0 (P61) SCLK0/ CTS0 (P62) TXD1 (P63) RXD1 (P64) SCLK1/ CTS1 (P65)
Serial I/O (Channel 0) Serial I/O (Channel 1)
ALE TEST1/TEST2 Interrupt controller INT0 (P35)
NMI
WAIT (P70)
P71 P72 P73 P74 P75 P76 P77 INT1/TI0 (P40)
Port 7
Watchdog timer 2-Kbyte RAM Port 0 AD0 to AD7* (P00 to P07) AD8 to AD15/A8 to A15* (P10 to P17) A0 to A7/A16 to A23* (P20 to P27)
RD (P30) * WR (P31) * HWR /SCK (P32)
8-bit timer (Timer 0) 8-bit timer (Timer 1)
Port 1
Port 2 8-bit timer (Timer 2) 8-bit timer (Timer 3) 64-Kbyte ROM INT4/TI4 (P42) INT5/TI5 (P43) TO4 (P44) INT6/TI6 (P45) INT7/TI7 (P46) TO6 (P47) 16-bit timer (Timer 4) 16-bit timer (Timer 5) Not included in the TMP93CS45 Port 3
TO3 (P41)
Wait controller (3 blocks) Serial bus interface controller SO/SDA (P33) SI/SCL (P34)
Note: The pin state after reset. Product TMP93CS44 AM8/ AM16 "H" level "H" level TMP93CS45 "L" level Pin Function after Reset Item in parentheses ( ) are the initial setting after reset. Except for "*" pins, item in parentheses ( ) are the initial setting after reset. Except for "*" pins, item in parentheses ( ) are the initial setting after reset. However, port 1 is initialized item of out parentheses.
Figure 1.1 TMP93CS44/TMP93CS45 Block Diagram
93CS44-3
2004-02-10
TMP93CS44/S45
2.
Pin Assignment and Functions
The assignment of input and output pins for the TMP93CS44/TMP93CS45, their names and functions are described below.
2.1
Pin Assignment
Figure 2.1.1 shows pin assignment of the TMP93CS44F/TMP93CS45F.
P32 (HWR/SCK) P31(WR) P30 (RD) VCC P27 (A23/A7) P26 (A22/A6) P25 (A21/A5) P24 (A20/A4) P23 (A19/A3) P22 (A18/A2) P21 (A17/A1) P20 (A16/A0) P17 (AD15/A15) P16 (AD14/A14) P15 (AD13/A13) P14 (AD12/A12) P13 (AD11/A11) P12 (AD10/A10) P11 (AD9/A9) P10 (AD8/A8) 60 55 50 45 41 40 (SO/SDA) P33 (SI/SCL) P34 (INT0) P35 (TI0/INT1) P40 (TO3) P41 (TI4/INT4) P42 (TI5/INT5) P43 (TO4) P44 (TI6/INT6) P45 (TI7/INT7) P46 (TO6) P47 VREFH VREFL AVSS AVCC (AN0) P50 (AN1) P51 (AN2) P52 (AN3/ ADTRG ) P53 (AN4) P54 61
65 35
70
TMP93CS44F/45F QFP80
30
Top view
75 25
P07 (AD7) P06 (AD6) P05 (AD5) P04 (AD4) P03 (AD3) P02 (AD2) P01 (AD1) P00 (AD0) ALE VSS VCC TEST2 TEST1 P67 (XT2) P66 (XT1)
RESET
EA
80 10 15 20 1 5
21
X2 X1 AM8/ AM16
Figure 2.1.1 Pin Assignment (P-LQFP80-1212-0.50E)
(TXD0) P60 (RXD0) P61 (SCLK0/CTS0) P62 (TXD1) P63 (RXD1) P64 (SCLK1/CTS1) P65 (WAIT) P70 P71 VSS P72 P73 P74 P75 P76 P77 CLK
(AN5) P55 (AN6) P56 (AN7) P57
NMI
93CS44-4
2004-02-10
TMP93CS44/S45
2.2
Pin Names and Functions
The names of input/output pins and their functions are described below. Table 2.2.1 to Table 2.2.3 show "Pin Names and Functions". Table 2.2.1 Pin Names and Functions (1/3)
Pin Names
P00 to P07 AD0 to AD7 P10 to P17 AD8 to AD15 A8 to A15 P20 to P27 A0 to A7 A16 to A23 P30
RD
Number of Pins
8 8
I/O
Functions
I/O Port 0: I/O port that allows selection of I/O on a bit basis
3 states Address/data (Lower): Bits 0 to 7 for address/data bus I/O Port 1: I/O port that allows selection of I/O on a bit basis 3 states Address/data (Upper): Bits 8 to 15 for address/data bus Output Address: Bits 8 to 15 for address bus 8 I/O Port 2: I/O port that allows selection of I/O on a bit basis (with pull-up resistor) Output Address: Bits 0 to 7 for address bus Output Address: Bits 16 to 23 for address bus 1 1 1 Output Port 30: Output port Output Read: Strobe signal for reading external memory Output Port 31: Output port Output Write: Strobe signal for writing data on pins AD0 to AD7 I/O Port 32: I/O port (with pull-up resistor) Output High write: Strobe signal for writing data on pins AD8 to AD15 I/O Mode clock SBI SIO mode clock 1 I/O Port 33: I/O port Output Serial send data I/O SBI I2C bus mode channel data 1 I/O Port 34: I/O port Input Serial receive data I/O SBI I2C bus mode clock 1 I/O Port 35: I/O port Input Interrupt request pin 0: Interrupt request pin with programmable level/rising edge 1 I/O Port 40: I/O port Input Timer input 0: Timer 0 input Input Interrupt request pin 1: Interrupt request pin with rising edge 1 1 I/O Port 41: I/O port Output Timer output 3: 8-bit timer 3 output I/O Port 42: I/O port Input Timer input 4: Timer 4 input Input Interrupt request pin 4: Interrupt request pin with programmable rising/falling edge
P31
WR
P32
HWR
SCK P33 SO SDA P34 SI SCL P35 INT0 P40 TI0 INT1 P41 TO3 P42 TI4 INT4
93CS44-5
2004-02-10
TMP93CS44/S45
Table 2.2.2 Pin Names and Functions (2/3) Number Pin Names of Pins
P43 TI5 INT5 P44 TO4 P45 TI6 INT6 P46 TI7 INT7 P47 TO6 P50 to P52, P54 to P57 AN0 to AN2, AN4 to AN7 P53 AN3
ADTRG
I/O
I/O Port 43: I/O port Input Timer input 5: Timer 4 input
Functions
1
Input Interrupt request pin 5: Interrupt request pin with rising edge 1 1 I/O Port 44: I/O port Output Timer output 4: Timer 4 output pin I/O Port 45: I/O port Input Timer input 6: Timer 5 input Input Interrupt request pin 6: Interrupt request pin with programmable rising/falling edge 1 I/O Port 46: I/O port Input Timer input 7: Timer 5 input Input 1 7 Interrupt request pin 7: Interrupt request pin with rising edge I/O Port 47: I/O port Output Timer output 6: Timer 5 output pin Input Port 50 to Port 52, Port 54 to Port 57: Input port Input Analog input: Analog signal input for AD converter 1 Input Port53: Input port Input Analog input: Analog signal input for AD converter Input AD converter external start trigger input 1 1 1 I/O Port 60: I/O port (with pull-up resistor) Output Serial send data 0 I/O Port 61: I/O port (with pull-up resistor) Input Serial receive data 0 I/O Port 62: I/O port (with pull-up resistor) I/O Serial clock I/O 0 Input Serial data send enable 0 (Clear to send) 1 1 1 I/O Port 63: I/O port (with pull-up resistor) Output Serial send data 1 I/O Port 64: I/O port (with pull-up resistor) Input Serial receive data 1 I/O Port 65: I/O port (with pull-up resistor) I/O Serial clock I/O 1 Input Serial data send enable 1 (Clear to send) 1 1 I/O Port 66: I/O port (Open-drain output) Input Low-frequency oscillator connecting pin I/O Port 67: I/O port (Open-drain output) Output Low-frequency oscillator connecting pin
P60 TXD0 P61 RXD0 P62 SCLK0
CTS0
P63 TXD1 P64 RXD1 P65 SCLK1
CTS1
P66 XT1 P67 XT2
93CS44-6
2004-02-10
TMP93CS44/S45
Table 2.2.3 Pin Names and Functions (3/3) Pin Names
P70
WAIT
Number of Pins
1
I/O
Functions
I/O Port 70: I/O port (High current output available)
Input WAIT: Pin used to request CPU bus wait (It is active in (1 + N) WAIT mode. Set by the bus-width/wait control register) 7 1 1 1 1 1 1 1 1 1 1 I/O Port 71 to Port 77: I/O port (High current output available) Input Power supply pin for AD converter Input GND pin for AD converter (0 V) Input Pin for high-level reference voltage input to AD converter Input Pin for low-level reference voltage input to AD converter Input Non-maskable interrupt request pin: Interrupt request pin with falling edge. Can also be operated at falling and rising edges by program. Input High-frequency oscillator connecting pin Output High-frequency oscillator connecting pin Input Reset: Initializes TMP93CS44/S45. (with pull-up resistor) Output Address latch enable. Can be disabled for reducing noise. Output Clock output: Outputs "fSYS / 2" clock. Pulled-up during reset. Can be disabled for reducing noise. Input External access: "0" should be inputted with TMP93CS45. "1" should be inputted with TMP93CS44. Input Address mode: Selects external data bus width. (The case of TMP93CS44) "1" should be inputted. The data bus width for external access is set by chip select/WAIT control register, port 1 control register. (The case of TMP93CS45) "0" should be inputted with fixed 16-bit bus width or 16-bit bus interlarded with 8-bit bus. "1" should be inputted with fixed 8-bit bus width. Input Power supply pin (All VCC pins should be connected with GND (0 V).) Input GND pin (0 V) (All VSS pins should be connected with GND (0 V).) Output/Input TEST1 should be connected with TEST2 pin. Do not connect to any other pins.
P71 to P77 AVCC AVSS VREFH VREFL
NMI
X1 X2
RESET
ALE CLK
EA
1
AM8/ AM16
1
VCC VSS TEST1/TEST2
2 2 2
Note:
Built-in pull-up resistors can be released from the pins other than the RESET pin by software.
93CS44-7
2004-02-10
TMP93CS44/S45
3.
Operation
This section describes the functions and basic operational blocks of TMP93CS44/S45 devices. See the 7. "Points of Note and Restriction" for the using notice and restrictions for each block.
3.1
CPU
TMP93CS44/S45 devices have a built-in high-performance 16-bit CPU (900/L CPU). (For CPU operation, see TLCS-900/L CPU in the previous section.) This section describes CPU functions unique to the TMP93CS44/S45 that are not described in the previous section.
3.1.1
Reset
When resetting the TMP93CS44/S45 microcontroller, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then set the RESET input to low level at least for 10 system clocks (16 s at 20 MHz). Thus, when turn on the switch, be set to the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then hold the RESET input to low level at least for 10 system clocks. Clock gear is initialized 1/16 mode by reset operation. It means that the system clock mode fSYS is set to fc/32 (= fc/16 x 1/2). When reset is accepted, the CPU sets as follows: * Program counter (PC) according to reset vector that is stored FFFF00H to FFFF02H. PC<7:0> Stored data in location FFFF00H PC<15:8> Stored data in location FFFF01H PC<23:16> Stored data in location FFFF02H Stack pointer (XSP) for system mode to 100H. Bits IFF2 to IFF0 of status register to 111. (Sets mask register to interrupt level 7.) MAX bit of status register to 1. (Sets to maximum mode.) Bits RFP2 to RFP0 of status register to 000. (Sets register banks to 0.)
* * * *
When reset is released, instruction execution starts from PC (Reset vector). CPU internal registers other than the above are not changed. When reset is accepted, processing for built-in I/Os, ports, and other pins is as follows. * * * * Initializes built-in I/O registers as per specifications. Sets port pins (including pins also used as built-in I/Os) to general-purpose input/output port mode. Pulls up the CLK pin to "H" level. Sets the ALE pin to "L" level (the case of TMP93CS45), to High-impedance (High-Z) (the case of TMP93CS44).
Note 1: By resetting, register in the CPU except program counter (PC), status register (SR) and stack pointer (XSP) and the data in internal RAM are not changed. Note 2: The CLK pin is pulled up to "H" level during reset. When the voltage is put down externally, there is possible to cause malfunctions. Figure 3.1.1 and Figure 3.1.2 show the reset timing chart of TMP93CS44 and TMP93CS45.
93CS44-8
2004-02-10
45 x 1 cycles omitted Total of 220 x 1 cycles omitted X1 CLK
Sampling RESET Sampling
A16 to A23
(P20 to P27 input mode)
ALE
Address Address Read RD
AD0 to AD15
Figure 3.1.1 TMP93CS44 Reset Timing Chart
93CS44-9
Address Data output Address WR HWR (P32 input mode) (Input mode) (Input mode)
AD0 to AD15
Write
P20 to P27, P32, P60 to P65
P33 to P35, P40 to P47, P50 to P57, P70 to P77 P66, P67
(Output mode: Open-drain output)
TMP93CS44/S45
2004-02-10
Internal pull up High-Z
45 x 1 cycles omitted Total of 220 x 1 cycles omitted X1 CLK
Sampling RESET Sampling
A16 to A23
(P20 to P27 input mode)
ALE
Address Address Address Data input Read RD
AD0 to AD15
Figure 3.1.2 TMP93CS45 Reset Timing Chart
Address Date output Address
93CS44-10
WR HWR (P32 input mode) (Input mode) (Input mode)
AD0 to AD15
Write
P20 to P27, P32, P60 to P65
P33 to P35, P40 to P47, P50 to P57, P70 to P77 P66, P67
(Output mode: Open-drain output)
TMP93CS44/S45
2004-02-10
Internal pull up High-Z
TMP93CS44/S45 3.1.2 AM8/ AM16 pin
(1) TMP93CS44 Set this pin to "H". After reset, the CPU accesses the internal ROM with 16-bit bus width. The bus width when the CPU accesses an external area is set by bus width/wait control registers and the registers of port 1, which are described in section 3.6.3. (The value of this pin is ignored and the value set by register is active.) (2) TMP93CS45 1. With fixed 16-bit data bus external 16-bit data bus or 8-bit data bus is selectable Set this pm to "L". Port 1, AD8 to AD15 and A8 to A15 pins are fixed to AD8 to AD15 functions. The values set in port 1 control register and port 1 function register are invalid. The external data bus width is set by the bus width/wait control register which is described in section 3.6.3. It is necessary to set the program memory to be accessed to 16-bit data bus after reset. 2. With fixed external 8-bit data bus Set this pin to "H". Port l, AD8 to AD15 and A8 to A15 pins are fixed to A8 to A15 functions. The values set in port 1 control register and port 1 function register are invalid. The values of bit4 , and in the bus width/wait control register described in section 3.6.3 are invalid. The external 8-bit data bus is fixed.
93CS44-11
2004-02-10
TMP93CS44/S45
3.2
Memory Map
Figure 3.2.1 is a memory map of the TMP93CS44/S45.
000000H 000080H 000100H Internal RAM (2 Kbytes) 000880H Internal I/O (128 bytes) 256-byte direct area (n)
64-Kbyte area (nn)
External memory
010000H
FF0000H
16-Mbyte area (r32) (-r32) (r32+) (r32 + d8/16) (r32 + r8/16) (nnn) 64-Kbyte internal ROM (TMP93CS44) External area for TMP93CS45
FFFF00H FFFFFFH
Vector table (256 bytes)
(
= Internal area)
Figure 3.2.1 Memory Map
93CS44-12
2004-02-10
TMP93CS44/S45
3.3
Dual Clock, Standby Function
Dual clock, standby control circuits consist of (1) System clock controller, (2) Prescaler clock controller and (3) Standby controller. The oscillator operating mode is classified to (a) Single clock mode (Only X1 and X2 pin), and (b) Dual clock mode (X1, X2, XT1 and XT2 pin). Figure 3.3.1 shows a transition figure. Figure 3.3.2 shows the block diagram. Figure 3.3.3 shows I/O registers. Table 3.3.1 shows the internal operation and system clock.
Reset RUN mode (Stops only CPU) IDLE2 mode
(Stops CPU and AD)
Instruction Interrupt Instruction Interrupt Instruction Interrupt
Release reset
Instruction Interrupt
NORMAL mode (fc/gear value/2)
STOP mode (Stops all circuits)
IDLE1 mode
(Operates only osciIIator)
(a) Single clock mode transition figure Reset RUN mode (Stops only CPU) IDLE2 mode
(Stops CPU and AD)
Release reset
Instruction Interrupt Instruction Interrupt Instruction Interrupt Instruction Interrupt
NORMAL mode (fc/gear value/2)
Instruction
IDLE1 mode
(Operates only oscillator)
RUN mode (Stops only CPU) IDLE2 mode
(Stops CPU and AD)
STOP mode (Stops all circuits)
Instruction Interrupt Instruction Interrupt Instruction Interrupt
SLOW mode (fs/2)
Instruction
IDLE1 mode
(Operates only oscillator)
(b) Dual clock mode transition figure
Figure 3.3.1 Transition Figure The clock frequency input from X1, X2 pin is called fc and the clock frequency input from XT1, XT2 pin is called fs. The clock frequency selected by SYSCR1 is called system clock fFPH. The devided clock of fFPH is called system clock fSYS, and the 1 cycle of fSYS, is called 1 state.
93CS44-13
2004-02-10
TMP93CS44/S45
Table 3.3.1 Internal Operation and System Clock Oscillator Operating Mode High Frequency Low Frequency
(fc) RESET NORMAL Single clock RUN IDLE2 IDLE1 STOP RESET NORMAL Dual clock SLOW RUN IDLE2 IDLE1 STOP Stop Oscillation Programmable Stop Programmable Oscillation Reset Operate Oscillation Stop Stop (fs) Reset Operate Reset Operate Stop only AD Stop Reset
CPU
Internal l/O
System Clock fSYS
fc/32 Programmable (fc/2, fc/4, fc/8, fc/16, fc/32) Stop fc/32 Programmable (fc/2, fc/4, fc/8, fc/16, fc/32)
Operate
fs/2 Programmable (fc/2, fc/4, fc/8, fc/16, fc/32, fs/2) Stop
Oscillator being used as system clock: Oscillation Other oscillator: Programmable Stop
Stop
Stop only AD Stop
93CS44-14
2004-02-10
* Warm up (Changing clocks)... fc or fs * Warm up (Releasing STOP mode) ... fFPH * Watchdog timer... fSYS SYSCR0
fc
fs
Watchdog timer/ warm-up timer
Run and stop TRUN fs fc/16
Selector
8-bit timers 0, 1, 2 and 3 16-bit timers 4 and 5 Serial interfaces 0 and 1 9-bit prescaler
Figure 3.3.2 Block Diagram of Dual Clock, Standby Circuits
/4 Internal I/O ROM, RAM System clock fSYS CPU
Lowfrequency oscillator
93CS44-15
fFPH SYSCR0 fs
Selector
SYSCR0
XT2
XT1
/2 /2 CLK
WDMOD SYSCR0
Selector
fc/2 fc/4 fc/8 fc/16
Highfrequency oscillator
SYSCR1 SYSCR0 SYSCR1
X2 fc /2 /4 /8 /16
TMP93CS44/S45
2004-02-10
X1
TMP93CS44/S45
System Clock Control Register 0 7
SYSCR0 (006EH) Bit symbol Read/Write After reset Function 1
Highfrequency oscillator (fc)
6
XTEN 0
Lowfrequency oscillator (fs)
5
RXEN 1
Highfrequency oscillator (fc) after released STOP mode
4
RXTEN 0
Lowfrequency oscillator (fs) after released STOP mode
3
RSYSCK R/W 0
2
WUEF 0
1
PRCK1 0
0
PRCK0 0
XEN
Select clock Warm-up timer after released (Write) STOP mode 0: fc 1: fs
0: Don't care 1: Start timer (Read) 0: End warm up 1: Not end warm up
Select prescaler clock 00: fFPH 01: fs 10: fc/16 11: (Reserved)
0: Stop 0: Stop 1: Oscillation 1: Oscillation
0: Stop 0: Stop 1: Oscillation 1: Oscillation
System Clock Control Register 1 7
SYSCR1 (006FH) Bit symbol Read/Write After reset Function 0
Select system clock 0: fc 1: fs
6
5
4
3
SYSCK
2
GEAR2 R/W 1
1
GEAR1 0
0
GEAR0 0
Select gear value of high frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved)
Clock Output Control Register 7
CKOCR (006DH) Bit symbol Read/Write After reset Function 0
Always write to "0".
6
- R/W 0
5
4
3
2
1
ALEEN R/W 0/1 (Note 2)
ALE pin output control 0: High-Z output 1: ALE output
0
CLKEN 0/1 (Note 2)
CLK pin output control 0: High-Z output 1: CLK output
-
Watchdog Timer Mode Control Register 7
WDMOD (005CH) Bit symbol Read/Write After reset Function 1
WDT control
6
WDTP1 0
WDT detection time 00: 2 /fSYS 01: 217/fSYS 19 10: 2 /fSYS 11: 221/fSYS
15
5
WDTP0 0
timer
4
WARM 0
Warm-up 0: 214/ frequency inputted 1: 216/ frequency inputted
3
HALTM1 R/W 0
HALT mode 00: RUN mode 01: STOP mode 10: IDLE1 mode 11: IDLE2 mode
2
HALTM0 0
1
RESCR 0
0: Don't care 1: Connects WDT output to RESET pin internally.
0
DRVE 0
Pin state control in STOP mode 0: I/O off 1: Remains the state before halt
WDTE
0: Disable 1: Enable
Note 1: Note 2:
Note 3:
SYSCR1 and CKOCR are read as "1". In the TMP93CS44, resetting sets , bit to "0" (High-impedance ALE and CLK). In the TMP93CS45, resetting sets , bit to "1" (output ALE and CLK). The CLK pin is internally pulled up during reset regardless of the product types. Writing "0" to SYSCR1 enables the high-frequency oscillator regardless of the value of SYSCR0. Additionally, writing "1" to register enebles the low-frequency oscillator regardless of th value of SYSCR0.
Figure 3.3.3 I/O Registers about Dual Clock, Standby
93CS44-16
2004-02-10
TMP93CS44/S45 3.3.1 System Clock Controller
The system clock controller generates system clock (fSYS) for CPU core and internal I/O. It contains two oscillation circuits and clock gear circuit for high frequency (fc). The register SYSCR1 changes system clock to either fc or fs, SYSCR0, controls enable/disable each oscillator, SYSCR1 changes high-frequency clock gear to either 1, 2, 4, 8 or 16 (fc, fc/2, fc/4, fc/8 or fc/16), and these functions can reduce the power consumption of the equipment in which the device is installed. The system clock (fSYS) is set to fc/32 (fc/16 x 1/2) because of = "1", = "0", = "0", = "100" by resetting. For example, fSYS is set to 0.625 MHz by resetting the case of 20 MHz oscillator is connected to X1, X2 pins. The high-frequency (fc) and low-frequency (fs) clocks can be easily obtained by connecting a resonator to the X1/X2, XT1/XT2 pins, respectively. Clock input from an external oscillator is also possible. The XT1, XT2 pins have also port 66, 67 function. Therefore the case of single clock mode, the XT1, XT2 pins can be used as I/O port pins.
High-frequency clock X1 X2 X1 X2 XT1 Low-frequency clock XT2 XT1 XT2 (Open) 74HCU04 Refer to chapter 5 "Application Circuit." (a) Crystal/ceramic resonator (b) External oscillator (c) Crystal resonator (d) External oscillator
Figure 3.3.4 Examples of Resonator Connection Note 1: Note on using the low-frequency oscillation circuit. In connecting the low-frequency resonator to ports 66 and 67, it is necessary to make the following settings to reduce the power consumption. (Connecting with resonators) P6CR = "11", P6 = "00" (Connecting with oscillators) P6CR = "11", P6 = "10" Note 2: Accurate adjustment of the oscillation frequency. The CLK pin outputs at 1/2 the system clock frequency (fSYS/2) is used to monitor the oscillation clock. With a system requiring adjustment of the oscillation frequency, an adjusting program must be written.
93CS44-17
2004-02-10
TMP93CS44/S45
(1) Switching from NORMAL to SLOW mode When the resonator is connected to X1, X2, or XT1, XT2 pin, the warm-up timer is used to change the operation frequency after getting stabilized oscillation. The warm-up time can be selected by WDMOD. This starting and ending of warm-up timer are performed like the following example 1, 2 by program. Note 1: The warm-up timer is also used as a watchdog timer. So, when it is used as a warm-up timer, the watchdog timer must be disabled. Note 2: The case of using oscillator (Not resonator) with stabilized oscillation, a warm-up timer is not need. Note 3: The warm-up timer is operated by a oscillation clock. Therefore, warm-up time has an error. Table 3.3.2 Warm-up Time Warm-up Time WDMOD
0 (214/frequency) 1 (216/frequency)
Change to NORMAL
0.8192 (ms) 3.2768 (ms)
Change to SLOW
500 (ms) 2000 (ms)
at fc = 20 MHz, fs = 32.768 kHz
93CS44-18
2004-02-10
TMP93CS44/S45
Clock setting example 1: Changing from the high frequency (fc) to the low frequency (fs).
SYSCR0 SYSCR1 WDCR WDMOD EQU EQU EQU EQU RES LD SET SET SET BIT JR SET RES SET 006EH 006FH 005DH 005CH 7, (WDMOD) (WDCR), B1H 4, (WDMOD) 6, (SYSCR0) 2, (SYSCR0) 2, (SYSCR0) NZ, WUP 3, (SYSCR1) 7, (SYSCR0) 7, (WDMOD)
WUP:
; ; ; ; ; ; ; ; ; ;
Disables watchdog timer. Sets warm-up time to 216/fs. Enables low-frequency oscillation Clears and starts warm-up timer. Detects end of warm-up timer. Changes fSYS from fc to fs. Disables high-frequency oscillation. Enables watchdog timer.
X1, X2 pins XT1, XT2 pins Warm-up timer End of warm-up timer System clock fSYS
Enables low frequency Clears and starts warm-up timer Changes fSYS Disables from fc to fs high frequency End of warm-up timer fc fs Counts up by fSYS Counts up by fs
93CS44-19
2004-02-10
TMP93CS44/S45
Clock setting example 2: Changing from the low frequency (fs) to the high frequency (fc).
SYSCR0 SYSCR1 WDCR WDMOD EQU EQU EQU EQU RES LD SET SET SET BIT JR SET RES SET 006EH 006FH 005DH 005CH 7, (WDMOD) (WDCR), B1H 4, (WDMOD) 7, (SYSCR0) 2, (SYSCR0) 2, (SYSCR0) NZ, WUP 3, (SYSCR1) 6, (SYSCR0) 7, (WDMOD)
WUP:
; ; ; ; ; ; ; ; ; ;
Disables watchdog timer. Sets warm-up time to 214/fc. Enables high-frequency (fc). Clears and starts warm-up timer. Detects end of warm-up timer. Changes fSYS from fs to fc. Disables low-frequency oscillation. Enable watchdog timer.
X1, X2 pins XT1, XT2 pins Warm-up timer End of warm-up timer System clock fSYS
Enables high frequency Clears and starts warm-up timer Change fSYS from fs to fc End of warm-up timer Disables low frequency fs fc Counts up by fSYS Counts up by fc
93CS44-20
2004-02-10
TMP93CS44/S45
(2) Clock gear controller When the high-frequency clock fc is selected at SYSCR1 = "0", the clock gear select register SYSCR1 sets fFPH to either fc, fc/2, fc/4, fc/8, fc/16. Switching fFPH with the clock gear reduces the power consumption. Clock setting example 3: Changing gear value of the high-frequency clock
SYSCR1 EQU 006FH
LD LD X: Don't care
(SYSCR1), XXXX0000B (SYSCR1), XXXX0100B
; Changes fSYS to fc/2. ; Changes fSYS to fc/32.
(High-frequency clock gear changing) To change the frequency of the clock gear, write the value to SYSCR1 register. It is necessary to continue the warm-up time until changing after writing the register value. There is a possibility that the instruction next to the clock gear changing instruction is executed by the clock gear before changing. To execute the instruction next to the clock gear changing instruction by the clock gear after changing, input the dummy instruction (Instruction to execute the write cycle) as follows.
Example: SYSCR1 EQU LD LD 006FH (SYSCR1), XXXX0001B (DUMMY), 00H
; Changes fSYS to fc/4. ; Dummy instruction.
Instruction to be executed by the clock gear after changing X: Don't care
93CS44-21
2004-02-10
TMP93CS44/S45 3.3.2 Prescaler Clock Controller
The 9-bit prescaler provides a clock to 8-bit timer 0, 1, 2, 3, 16-bit timer 4, 5, and serial interface 0, 1. The clock input to the 9-bit prescaler is selected either fFPH, fc/16, or fs by SYSCR0 register. register is initialized to "00" by resetting. When the IDLE 1 mode (Operates only oscillator) is used, set TRUN to "0" to stop 9 bit prescaler before "HALT" instruction is executed.
3.3.3
Internal Clock Pin Output Function
CLK pin outputs fSYS divided by 2 internal clock. Outputs are specified by the clock output control register CKOCR. Writing "1" sets clock output, and writing "0" sets high impedance. After reset, CKOCR is depended on each product types. It is necessary to set for each usage. Table 3.3.3 shows the value and operation after reset. During reset, CLK pin is internally pulled up regardless of the value of register. See "TMP93CS44/S45 Reset Timing Chart" in Figure 3.1.1 and Figure 3.1.2. Table 3.3.3 and CLK Pin Operation after Reset Type Number
TMP93CS44 TMP93CS45
CKOCR
0 1
CLK Pin Operation
High impedance fSYS/2 clock output
Note: To set = "0" and set CLK pin to high impedance, pull up externally to prevent through current which follows to the input buffer of CLK pin.
93CS44-22
2004-02-10
TMP93CS44/S45 3.3.4 Standby Controller
(1) HALT mode When the HALT instruction is executed, the operating mode changes RUN, IDLE2, IDLE1 or STOP mode depending on the contents of the HALT mode setting register WDMOD. Figure 3.3.5 shows the alternative states of watchdog timer mode registers. Watchdog Timer Mode Register 7
WDMOD (005CH) Bit symbol Read/Write After reset Function 1
Watchdog timer control 0: Disable 1: Enable
6
WDTP1 0
5
WDTP0 0
timer
4
WARM 0
Warm-up 0: 2 /clock frequency selection 1: 2 /clock frequency selection
16 14
3
HALTM1 R/W 0
2
HALTM0 0
1
RESCR 0
Runaway detection internal reset control 1: Executes internal reset by runaway detection
0
DRVE 0
STOP mode pin control 1: Drive pins in STOP mode
WDTE
Watchdog timer detect time selection
HALT mode selection 00: 01: 10: 11: RUN mode STOP mode IDLE1 mode IDLE2 mode
00: 215/fSYS 01: 217/fSYS 10: 219/fSYS 11: 221/fSYS
Pin state control in STOP mode 0 I/O off 1 Retains the state before halt HALT mode setting 00 RUN mode (Only CPU stop) 01 10 11 STOP mode (All circuits stop) IDLE1 mode (Only oscillator operating) IDLE2 mode (Partial I/O operating)
Warm-up time selection at returning from the stop mode (see Table 3.3.6) 0 214/select clock frequency 1 216/select clock frequency
Figure 3.3.5 Watchdog Timer Mode Register The futures of RUN, IDLE2, IDLE1 and STOP modes are as follows. 1. RUN: Only the CPU halts; power consumption remains unchanged. 2. IDLE2: The built-in oscillator and the specified I/O operates. The power consumption is reduced to 1/2 than that during NORMAL operation. 3. IDLE1: Only the built-in oscillator operates, while all other built-in circuits stop. Consumption is reduced to 1/5 or less than that during NORMAL operation. 4. STOP: All internal circuits including the built-in oscillator stop. This greatly reduces power consumption.
93CS44-23
2004-02-10
TMP93CS44/S45
The operations in the halt state is described in Table 3.3.4. Table 3.3.4 I/O Operation during HALT Mode
HALT mode WDMOD CPU I/O Port 8-bit timer 16-bit timer BLOCK Serial channel Serial bus interface AD converter Watchdog timer Interrupt controller Operate Stop RUN 00 IDLE2 11 Stop
Keep the state when the "HALT" instruction was executed. See Table 3.3.7
IDLE1 10
STOP 01
(2) How to release the HALT mode These halt states can be released by resetting or requesting an interrupt. The halt release sources are determined by the combinations between the states of interrupt mask register and the HALT modes. The details for releasing the halt status are shown in Table 3.3.5. * Released by requesting an interrupt The operating released from the HALT mode depends on the interrupt enabled status. When the interrupt request level set before executing the HALT instruction exceeds the value of the interrupt mask register, the interrupt due to the source is processed after releasing the HALT mode, and CPU starts executing an instruction that follows the HALT instruction. When the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, releasing the HALT mode is not executed (in non-maskable interrupts, interrupt processing is processed after releasing the HALT mode regardless of the value of the mask register.) However only for INT0 interrupts, even if the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, releasing the HALT mode is executed. In this case, interrupt processing is not processed, and CPU starts executing the instruction next to the HALT instruction, but the interrupt request flag is held at "1". Note: Usually, interrupts can release all halts status. However, the interrupts = ( NMI , INT0) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (RUN and IDLE2 are not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, halt status can be released without difficultly. The priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt. Release by resetting Releasing all halt status is executed by resetting. When the STOP mode is released by RESET, it is necessary enough resetting time (3 ms or more) to set the operation of the oscillator to be stable. When releasing the HALT mode by resetting, the internal RAM data keeps the state before the "HALT" instruction is executed. However the other setting contents are initialized. (Releasing due to interrupts keep the state before the "HALT" instruction is executed.)
*
93CS44-24
2004-02-10
TMP93CS44/S45
Table 3.3.5 Halt Releasing Source and Halt Releasing Operation Interrupt Receiving Status HALT mode
NMI INTWDT INT0 INT1, INT4 to INT7
Halt releasing Interrupt source
Interrupt Enable
(Interrupt level) (Interrupt mask)
Interrupt Disable
(Interrupt level) < (Interrupt mask)
INTT0 to INTT3 INTTR4 to INTTR7 INTTO4, INTTO5 INTRX0, INTTX0 INTRX1, INTTX1 INTS2 INTAD
RESET
RUN
IDLE2
x
IDLE1
x
STOP *1
x
RUN
- -
IDLE2
- -
IDLE1
- -
STOP
- -

x
x x x x x x x x
*1
x x x x x x x x
x x x x x x x x
x x x x x x x x
x x x x x x x x
*1
x x x x x x x x

: :
x: -:
After releasing the HALT mode, CPU starts interrupt processing. (RESET initializes LSI.) After releasing the HALT mode, CPU starts executing an instruction that follows the HALT instruction. It can not be used to release the HALT mode. This combination type does not exist because the priority level (Interrupt request level) of non-maskable interrupts is fixed to highest priority level "7". Releasing the HALT mode is executed after passing the warm-up time. When releasing the HALT mode is executed by INT0 interrupt of the level mode in the interrupt enabled status, hold level "H" until starting interrupt processing. If level "L" is set before holding level "L", interrupt processing is correctly started.
*1: Note:
(Example releasing "RUN" mode) INT0 interrupt releases halt state when the RUN mode is on.
Address 8203H 8206H 8209H 820BH 820EH INT0 820FH LD XX, XX LD LD EI LD HALT (IIMC), 00H (INTE0AD), 06H 5 (WDMOD), 00H ; Selects interrupt rising edge for INT0. ; Sets interrupt level to "6" for INT0. ; Sets interrupt level to "5" for CPU. ; Sets HALT mode to "RUN". ; Halts CPU. INT0 interrupt routine RETI
When halt is released by reset, the states (Including those of the internal RAM) before halt state was entered can be maintained. However, if the HALT instruction is executed within the internal RAM, the contents of the RAM may not be maintained. In this case, we recommend releasing the halt state using INT0.
93CS44-25
2004-02-10
TMP93CS44/S45
(3) Operation 1. RUN mode In the RUN mode, the system clock continues to operate even after a HALT instruction is executed. Only the CPU stops executing the instruction. In the halt state, an interrupt request is sampled with the falling edge of the "CLK" signal. Releasing the RUN mode is executed by the external/internal interrupts. (See Table 3.3.5 "Halt Releasing Source and Halt Releasing Operation".) Figure 3.3.6 shows the interrupt timing for releasing the halt state by interrupts in the RUN/IDLE2 mode.
X1 CLK A0 to A23 ALE AD0 to AD15
RD WR NMI
Address Data Address Address Data
Address
Address + 2
INT0 (Level) INT1, INT4 to INT7 (Rising edge) INT4, INT6 (Falling edge) Internal INT RUN/IDLE2 mode
Figure 3.3.6 Timing Chart for Releasing the Halt State by Interrupt in RUN/IDLE2 Modes 2. IDLE2 mode In the IDLE2 mode, the system clock is supplied to only specific internal I/O devices, and the CPU stops executing the current instruction. In the IDLE2 mode, the halt state is released by an interrupt with the same timing as in the RUN mode. The IDLE2 mode is released by external/internal interrupt, except INTWDT/INTAD interrupts. (See Table 3.3.5 "Halt Releasing Source and Halt Releasing Operation".) In the IDLE2 mode, the watchdog timer should be disabled before entering the halt status to prevent the watchdog timer interrupt occurring just after releasing the HALT mode.
93CS44-26
2004-02-10
TMP93CS44/S45
3. IDLE1 mode In the IDLE1 mode, only the internal oscillator operates. The system clock in the MCU stops, the CLK pin is fixed at the level "H" in the output enable (CKOCR = "1"). In the halt state, and interrupt request is sampled asynchronously with the system clock, however the halt release (Restart of operation) is performed synchronously with it. IDLE1 mode is released by external interrupts (NMI, INT0). (See Table 3.3.5 "Halt Releasing Source and Halt Releasing Operation".) When the IDLE1 mode is used, setting TRUN to "0" to stop 9-bit prescaler before "HALT" instruction reduces the power consumption. Figure 3.3.7 illustrates the timing for releasing the halt state by interrupts in the IDLE1 mode.
X1 CLK A0 to A23 ALE AD0 to AD15
RD WR NMI
Address Data Address Data
Address
Address + 2
INT0 (Level) INT0 (Rising edge) IDLE1 mode
Figure 3.3.7 Timing Chart of Halt Released by Interrupts in IDLE1 Mode
93CS44-27
2004-02-10
TMP93CS44/S45
4. STOP mode The STOP mode is selected to stop all internal circuits including the internal oscillator. The pin status in the STOP mode depends on setting of a bit in the watchdog timer mode register WDMOD. (See Figure 3.3.5 for setting of WDMOD.) Table 3.3.7 summarizes the state of these pins in the STOP mode. The STOP mode is released by external interrupts (NMI, INT0). When the STOP mode is released, the system clock output starts after warm-up time required to attain stable oscillation. The warm-up time can be set using WDMOD. See the example of warm-up time (Table 3.3.6). In a system which supplies stable clock generated by an external oscillator, the warm-up time can be reduced by using the setting of T45CR. Figure 3.3.8 illustrates the timing for releasing the halt state by interrupts during the STOP mode.
Warm-up time X1 CLK A0 to A23 ALE AD0 to AD15
RD WR NMI
Address Data Address Data
Address
Address + 2
INT0 (Level) INT0 (Rising edge) STOP mode
Figure 3.3.8 Timing Chart of Halt State Release by Interrupts in STOP Mode
93CS44-28
2004-02-10
TMP93CS44/S45
Table 3.3.6 The Example of Warm-up Time after Releasing the STOP Mode Warm-up Time [ms] Clock Operation Frequency after the STOP Mode WDMOD = 0 WDMOD = 1
fc fc/2 fc/4 fc/8 fc/16 fs 0.8192 1.6384 3.2768 6.5536 13.1072 500 3.2768 6.5536 13.1072 26.2144 52.4288 2000 fs = 32.768 kHz fc = 20 MHz
Clock Frequency
How to calculate the warm-up time 14 WDMOD = 0: Clock operation frequency after the 2 /STOP mode. 16 WDMOD = 1: Clock operation frequency after the 2 /STOP mode. The NORMAL/SLOW mode selection is possible after released STOP mode. This is selected by SYSCR0. Therefore, Setting to , , is necessary before "HALT" instruction is executed. Setting example: The STOP mode is entered when the low-frequency (fs) operates, and after that high-frequency operates after releasing by NMI .
Address SYSCR0 SYSCR1 WDMOD 8FFDH 9000H 9002H 9005H
NMI
EQU EQU EQU LD RES LD HALT
006EH 006FH 005CH (SYSCR1), 08H 4, (WDMOD) (SYSCR0), -11000 - - B
; fSYS = fs/2. ; Sets warm-up time to 214/fc. ; Operates high frequency after released.
Clears and starts warm-up timer. (High frequency) End
NMI Interrupt routine.
9006H
LD
XX, XX
RETI
-: No change
Note:
When different modes are used before and after STOP mode as the above mentioned, there is possible to release the HALT mode without changing the operation mode by acceptance of the halt release interrupt request during execution of "HALT" instruction (during 8 states). In the system which accepts the interrupts during execution "HALT" instruction, set the same operation mode before and after the STOP mode.
93CS44-29
2004-02-10
TMP93CS44/S45
Table 3.3.7 Pin States in STOP Mode Pin Name
P00 to P07 Input mode Output mode AD0 to AD7 P10 to P17 Input mode Output mode/A8 to A15 AD8 to AD15 P20 to P27 Input mode Output mode A0 to A7/A16 to A23 P30 (RD), P31 (WR) P32 (HWR/SCK) P33 to P35 P40 to P47 P50 to P57 P60 to P65 P70 to P77
NMI
I/O
TMP93CS44 = 0
High-Z High-Z High-Z High-Z High-Z PU* PU* Invalid High-Z Invalid High-Z PU* PU* Invalid High-Z Input "L" level output High-Z Input "H" level fix "H" level fix Invalid "H" level output Invalid High-Z Invalid High-Z
TMP93CS45 = 0
x x High-Z x x High-Z High-Z
= 1
Output High-Z Output High-Z Output Output PU Output Invalid Output Invalid Output PU Output Invalid Output Input "L" level output "H" level output Input "H" level fix "H" level fix Invalid "H" level output Invalid Output* Invalid Output*
= 1
x x High-Z x x High-Z Output "H" level output
Output Input mode Output mode Input mode Output mode Input mode Output mode Input Input mode Output mode Input mode Output mode Input Output ( = 1) Output ( = 1) Input Input Input Input Output Input mode Output mode XT1
The same as for TMP93CS44
ALE CLK
RESET
EA
"L" level fix Input
"L" level fix Input
AM8/ AM16 X1 X2 P66
The same as for TMP93CS44
P67
Input mode Output mode XT2
Input: Input gate in operation. Fix input voltage to 0 or 1 so that the input pin stays constant. Output: Output state. Output*: Open-drain output state. Input gate in operation. Set output to "L" or attach pull up on pin so that the input gate stays constant. Invalid: Input is not accepted. High-Z: Output is at high impedance. PU: Programmable pull-up pin in input gate in operation. Fix the pin to avoid through current since the input gate operates when a pull-up pin resistor is not set. PU*: Programmable pull-up pin in input gate disable state. No through current even if the pin is set to high impedance. : When a HALT instruction is executed and the CPU stops at the address of the port register, an input gate operates. Fix the pin to avoid through current, and change the program. Cannot set. x: : To connect a low-frequency resonator to port 66 and port 67, it is necessary to set the following procedures to reduce the consumption power supply. (Connecting to a resonater) Set P6CR = "11", P6 = "00" (Connecting to an oscillator) Set P6CR = "11", P6 = "10" Note: Port registers are used for controlling programmable pull up. If a pin is also used for an output function (e.g., TO3) and the output function is specified, whether pull up is selected depends on the output function data. If a pin is also used for an input function, whether pull up is selected depends on the port register setting value only.
93CS44-30
2004-02-10
TMP93CS44/S45
3.4
Interrupts
TLCS-900 interrupts are controlled by the CPU interrupt mask flip-flop and the built-in interrupt controller. Altogether the TMP93CS44/S45 have the following 33 interrupt sources: Internal interrupts ............................ 26 * * * * Software interrupts: 8 Illegal instruction execution: 1 Interrupts from built-in I/Os: 17 External pins ( NMI , INT0, INT1, INT4, to INT7)
External interrupts ........................... 7
A fixed individual interrupt vector number is assigned to each interrupt source; six levels of priority can also be assigned to each maskable interrupt. Non-maskable interrupts have a fixed priority of 7. When an interrupt is generated, the interrupt controller sends the value of the priority of the interupt source to the CPU. When more than one interrupt is generated simultaneously, the interrupt controller sends the value of the highest priority (7 for non-maskable interrupts is the highest) to the CPU. The CPU compares the value of the priority sent with the value in the CPU interrupt mask register . If the value is greater than that the CPU interrupt mask register, the interrupt is accepted. The value in the CPU interrupt mask register can be changed using the EI instruction (Executing EI n changes the contents of to n). For example, programming EI 3 enables acceptance of maskable interrupts with a priority of 3 or greater, and non-maskable interrupts which are set in the interrupt controller. The DI instruction ( = 7) operates in the same way as the EI 7 instruction. Since the priority values for maskable interrupts are 0 to 6, the DI instruction is used to disable acceptance of maskable interrupts. The EI instruction becomes effective immediately after execution (with the TLCS-90, the EI instruction becomes effective after execution of the subsequent instruction). In addition to the general-purpose interrupt processing mode described above, there is also a micro DMA processing mode. Micro DMA is a mode used by the CPU to automatically transfer byte or word data. It enables the CPU to process interrupts such as data saves to built-in I/Os at high speed. Figure 3.4.1 is a flowchart showing overall interrupt processing.
93CS44-31
2004-02-10
TMP93CS44/S45
Interrupt processing
Read interrupt vector V. Clear interrupt request F/F.
Start vector match of vector V and micro DMA No PUSH PC PUSH SR SR Accepted interruput level +1 INTNEST INTNEST + 1
Yes
Data transfer by micro DMA
General-purpose interrupt processing
COUNT COUNT - 1
Micro DMA processing
Yes PC (FFFF00H + V)
COUNT = 0
No Interrupt processing program
RETI instruction POP SR POP PC INTNEST INTNEST - 1
End
Figure 3.4.1 Interrupt Processing Flowchart
93CS44-32
2004-02-10
TMP93CS44/S45 3.4.1 General-purpose Interrupt Processing
When accepting an interrupt, the CPU operates as follows. In the cases of software interrupts or interrupts generated by the CPU because of attempts to execute illegal instructions, the following steps (1) and (3) are not executed. (1) The CPU reads the interrupt vector from the interrupt controller. When more than one interrupt with the same level is generated simultaneously, the interrupt controller generates interrupt vectors in accordance with the default priority (which is fixed as follows: The smaller the vector value, the higher the priority), then clears the interrupt request. (2) The CPU pushes the program counter and the status register to the system stack area (Area indicated by the system mode stack pointer (XSP)). (3) The CPU sets a value in the CPU interrupt mask register that is higher by 1 than the value of the accepted interrupt level. However, if the value is 7, 7 is set without an increment. (4) The CPU increments the INTNEST (Interrupt nesting counter). (5) The CPU jumps to address stored at FFFF00H + interrupt vector, then starts the interrupt processing routine. The following diagram shows all the above processing state number. Bus Width of Stack Bus Width of Area Interrupt Vector Area
8 bits 16 bits 8 bits 16 bits 8 bits 16 bits
Interrupt Processing State Number
35 31 29 25
To return to the main routine after completion of the interrupt processing, the RETI instruction is usually used. Executing this instruction restores the contents of the program counter and the status registers and decrements INTNEST (Interrupt nesting counter). Though acceptance of non-maskable interrupts cannot be disabled by program, acceptance of maskable interrupts can. A priority can be set for each source of maskable interrupts. The CPU accepts an interrupt request with a priority higher than the value in the CPU mask register . The CPU mask register is set to a value higher by 1 than the priority of the accepted interrupt. Thus, if an interrupt with a level higher than the interrupt being processed is generated, the CPU accepts the interrupt with the higher level, causing interrupt processing to nest. The interrupt request with a priority higher than the accepted now interrupt during the CPU is processing above (1) to (5) is accepted before the 1'st instruction in the interrupt processing routine, causing interrupt processing to nest. (This is the same case of over lapped each non-maskable interrupt (level 7).) The CPU does not accept an interrupt request of the same level as that of the interrupt being processed. Resetting initializes the CPU mask registers to 7; therefore, maskable interrupts are disabled.
93CS44-33
2004-02-10
TMP93CS44/S45
The following (1) to (5) show a flowchart of interrupt processing. (1) Maskable interrupt
(Main) EI 1 [1] INTT0 (Level 1) [5] [4] IFF 1 (INTT0 interrupt routine) IFF 2 [2] [3] RETI
(2) Non-maskable interrupt
(Main) D1 [1]
NMI
(NMI interrupt routine) IFF 7 [2] [3] [4] IFF 7 RETI
(Level 7) [5]
During execution of the main program, the CPU accepts an interrupt request. The CPU increments the IFF so that the interrupts of level 1 are not accepted during processing the interrupt routine.
DI instruction is executed in the main program, so that the interrupts of only level 7 are accepted. The CPU does not increment the IFF even if the CPU accepts an interrupt request of level 7.
(3) Interrupt nesting
(Main) EI 3 [1] INTT0 (Level 3) [9] [8] IFF 3
(4) Software interrupt
(Main) D1 [1] [5] RETI [6] IFF 4 SWI3 [3] [5] [4] RETI (SWI3 routine)
(INTT0 interrupt routine) (INTT1 interrupt routine) IFF 4 [2] [3] INTT1 (Level 4) [7] RETI IFF 5 [4]
[2]
During processing the interrupts of level 3, the IFF is set to 4. When an interrupt with a level higher than level 4 is generated, the CPU accepts the interrupt with the higher level, causing interrupt processing to nest.
The CPU accepts the software interrupt request during DI status (IFF = 7) because of the level 7. The IFF is not changed by the software interrupts.
(5) Interrupt sampling timing
(INTT0 interrupt routine) (Main) EI 3 [1] INTT0 (Level 3) [8] [7] INTT1 (Level 4) [2] [3] Example: XXX [6] [5] [4] (Underline): Instruction [1], [2], ...: Execution flow
RETI
RETI
If an interrupt with a level higher than the interrupt being processed is generated, the CPU accepts the interrupt with the higher level. The program counter which returns at e is the start address of INTT0 interrupt routine.
93CS44-34
2004-02-10
TMP93CS44/S45
The addresses FFFF00H to FFFFFFH (256 bytes) of the TMP93CS44/S45 are assigned for interrupt vector area. Table 3.4.1 TMP93CS44/S45 Interrupt Table
Default Priority 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 - to - Type Interrupt Source Reset or SWI0 instruction SWI 1 instruction Illegal instruction, or SWI2 SWI 3 instruction SWI 4 instruction SWI 5 instruction SWI 6 instruction SWI 7 instruction NMI: NMI pin input INTWD: Watchdog timer INT0: INT0 pin input INT1: INT1 pin input INT4: INT4 pin input INT5: INT5 pin input INT6: INT6 pin input INT7: INT7 pin input INTT0: 8-bit timer 0 INTT1: 8-bit timer 1 INTT2: 8-bit timer 2 INTT3: 8-bit timer 3 INTTR4: 16-bit timer 4 (TREG4) INTTR5: 16-bit timer 4 (TREG5) INTTR6: 16-bit timer 5 (TREG6) INTTR7: 16-bit timer 5 (TREG7) INTTO4: 16-bit timer 4 (Overflow) INTTO5: 16-bit timer 5 (Overflow) INTRX0: Serial receive (Channel 0) INTTX0: Serial send (Channel 0) INTRX1: Serial receive (Channel 1) INTTX1: Serial send (Channel 1) INTAD: AD conversion completion INTS2: Serial bus send and receive (Reserved) to (Reserved) Vector Value "V" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 2 2 0 4 8 C 0 4 8 C 0 4 H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H H Address Refer to Vector FFFF00H FFFF04H FFFF08H FFFF0CH FFFF10H FFFF14H FFFF18H FFFF1CH FFFF20H FFFF24H Micro DMA Start Vector - - - - - - - - 08H 09H 0AH 0BH 0CH 0DH 0EH 0FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH - to -
Nonmaskable
Maskable
28 2C 30 34 38 3C 40 44 48 4C 50 54 58 5C 60 64 68 6C 70 74 78 7C 80 to 00FC
FFFF28H FFFF2CH FFFF30H FFFF34H FFFF38H FFFF3CH FFFF40H FFFF44H FFFF48H FFFF4CH FFFF50H FFFF54H FFFF58H FFFF5CH FFFF60H FFFF64H FFFF68H FFFF6CH FFFF70H FFFF74H FFFF78H FFFF7CH FFFF80H to H FFFFFCH
93CS44-35
2004-02-10
TMP93CS44/S45
Setting to reset/interrupt vector 1. Reset vector
FFFF00H FFFF01H FFFF02H FFFF03H PC<7:0> PC<15:8> PC<23:16> XX
The vector base addresses are depended on the products.
Type Number TMP93CS44 TMP93CS45 TMP93PS44 TMP93CU44 TMP93CW44 TMP93PW44A FFFF00H Vector Base Address PC Setting Sequence after Reset PC<7:0> Address FFFF00H PC<15:8> Address FFFF01H PC<23:16> Address FFFF02H Notes P27 to P20/A23 to A16 pins input ports with pull-up due to reset. The logic data is "FFH". When port 2 is used as A23 to A16 pins to access the program ROM, set PC<23:16> to "FFH" and the reset vector to "FF0000H to FFFFFFH" (for mainly products without ROM).
2.
Interrupt vector (except reset vector)
Address refer to vector +0 +1 +2 +3 PC<7:0> PC<15:8> PC<23:16> XX
XX: Don't care
93CS44-36
2004-02-10
TMP93CS44/S45
(Setting example) Sets the reset vector: FF0000H, NMI vector: FF9ABCH, INTAD vector: 123456H.
ORG DL ORG DL ORG DL ORG LD FFFF00H FF0000H FFFF20H FF9ABCH FFFF78H 123456H FF0000H A, B ; Reset = FF0000H. ; NMI = FF9ABCH. ; INTAD = 123456H.
ORG LD
FF9ABCH B, C
Note: ORG, DL are assembler directives. ORG: Control location counter. DL: Defines long word (32 bits) data.
ORG LD
123456H C, A
93CS44-37
2004-02-10
TMP93CS44/S45 3.4.2 Micro DMA
In addition to the conventional interrupt processing, the TLCS-900 also has a micro DMA function. When an interrupt is accepted, in addition to an interrupt vector, the CPU receives data indicating whether processing is micro DMA mode or general-purpose interrupt. If micro DMA mode is requested, the CPU performs micro DMA processing. The TLCS-900 can process at very high speed because it has transfer parameters in dedicated registers in the CPU. Since those dedicated registers are assigned as CPU control registers, they can only be accessed by the LDC instruction. (1) Micro DMA operation Micro DMA operation starts when the accepted interrupt vector value matches the micro DMA start vector value. The micro DMA has four channels so that it can be set for up to four types of interrupt source. When a micro DMA interrupt is accepted, data is automatically transferred from the transfer source address to the transfer destination address set in the control register, and the transfer counter is decremented. If the value in the counter after decrementing is other than 0, micro DMA processing is completed; if the value in the counter after decrementing is 0, general-purpose interrupt processing is performed. 32-bit control registers are used for setting transfer source/destination addresses. However, the TLCS-900 has only 24 address pins for output. A 16-Mbyte space is available for the micro DMA. There are two data transfer modes: one-byte mode and one-word mode. Incrementing, decrementing, and fixing the transfer source/destination address after transfer can be done in both modes. Therefore data can easily be transferred between I/O and memory and between I/Os. For details of transfer modes, see the description of transfer mode registers. The transfer counter has 16 bits, so up to 65536 transfers (the maximum when the initial value of the transfer counter is 0000H) can be performed for one interrupt source by micro DMA processing. When the transfer counter is decremented to "0" after data is transferred with micro DMA, general-purpose interrupt processing is performed. After processing the general-purpose interrupt, starting the interrupts of the same channel restarts the transfer counter from 65536. If necessary, reset the transfer counter. Interrupt sources processed by micro DMA processing are those with the micro DMA start vectors listed in Table 3.4.1. The following timing chart is a micro DMA cycle of the transfer address INC (Increment) mode (Condition: MAX mode, 16-bit bus width for 16 MBytes, 0 waits).
93CS44-38
2004-02-10
1 state DM3 DM4 DM5 DM6 DM7 DM8 DM9 DM10 DM11 DM12 DM13 DM14
(Note 1)
(Note 2)
(Note 3)
(Note 3)
(Note 3)
DM1
DM2
DM15
DM16
X1
ALE
A0 to A15
A0 to A15
AD0 to AD15
D0 to D15
D0 to D15
A0 to A15
D0 to D15
A0 to A15
D0 to D15
A0 to A15
D0 to D15
A16 to A23 Dummy Source address Destination address Dummy Address
Dummy
Address + 2
Address + 4
RD
WR, HWR
Figure 3.4.2 Micro DMA Cycle (COUNT 0)
93CS44-39
Note 1:
These 2 states are added in the case that the bus width of the source address area is 8 bits or the address starts from an odd number.
Note 2:
These 2 states are added in the case that the bus width of the destination address area is 8 bits or the address starts from an odd number.
Note 3:
This may be a dummy cycle with an instruction queue buffer.
TMP93CS44/S45
2004-02-10
(Note 1) DM3 DM4 DM5 DM6 DM7 DM8 DM9 DM10 DM11 DM12 DM13 DM14 DM15
(Note 2)
(Note 3)
(Note 3) DM16
DM1
DM2
X1
ALE
A0 to A15 D0 to D15 A0 to A15
AD0 to AD15
D0 to D15 A0 to A15 D0 to D15 A0 to A15
D0 to D15
A16 to A23 Dummy Source address Destination address Dummy Address
Dummy
Address + 2
Dummy
RD
WR, HWR
(Note 4) (Note 4) DM21 DM22 DM23 DM24 DM25 DM26 DM27 (Note 4) DM18 DM19 DM20
DM17
DM28
DM29
DM30
DM31
DM32
X1
ALE XSP-6 XSP-4 XSP-2 Dummy FFFF00H + V FFFF02H + V Dummy
AD0 to AD15
Dummy
Figure 3.4.3 Micro DMA Cycle (COUNT = 0)
DM34 DM35 DM36 DM37 Address Address + 2
93CS44-40
RD
WR, HWR
DM33
X1
ALE
AD0 to AD15
Dummy
RD
WR, HWR
Note 1:
These 2 states are added in the case that the bus width of the source address area is 8 bits or the address starts from an odd number.
Note 2:
These 2 states are added in the case that the bus width of the destination address area is 8 bits or the address starts from an odd number.
Note 3:
This be a dummy cycle with an instruction queue buffer.
TMP93CS44/S45
2004-02-10
Note 4:
These 2 states are added in the case of the bus width of stack address area is 8 bits or stack pointer starts from an odd number.
TMP93CS44/S45
(2) Register configuration (CPU control register)
Channel 0 DMAS0 DMAD0 DMAC0 DMAM0 Channel 1 DMAS1 DMAD1 DMAC1 DMAM1 Channel 2 DMAS2 DMAD2 DMAC2 DMAM2 Channel 3 DMAS3 DMAD3 DMAC3 DMAM3 8 bits 16 bits 32 bits Transfer source address register 3 Transfer destination address register 3 Transfer counter register 3 Transfer mode register 3 Transfer source address register 2 Transfer destination address register 2 Transfer counter register 2 Transfer mode register 2 Transfer source address register 1 Transfer destination address register 1 Transfer counter register 1 Transfer mode register 1 Transfer source address register 0 Transfer destination address register 0 Transfer counter register 0 (1 to 65536) Transfer mode register 0 (Use only lower 24 bits.)
These control register can not be set only "LDC cr, r" instruction.
Example: LD LDC LD LDC LD LDC LD LDC XWA, 100H DMAS0, XWA XWA, 50H DMAD0, XWA WA, 40H DMAC0, WA A, 05H DMAM0, A
93CS44-41
2004-02-10
TMP93CS44/S45
(3) Transfer mode register details
(DMAM0 to DMAM3) 0 0 0 0 Mode Note: When setting values for this register, set the upper 4 bits to 0.
Z 0 = byte transfer, 1 = word transfer 0 0 0 Z Transfer destination address INC mode............................ for I/O to memory (DMADn+) (DMASn) DMACn DMACn - 1 if DMACn = 0 then INT. Transfer destination address DEC mode .......................... for I/O to memory (DMADn-) (DMASn) DMACn DMACn - 1 if DMACn = 0 then INT. Transfer source address INC mode .................................. for memory to I/O (DMADn) (DMASn+) DMACn DMACn - 1 if DMACn = 0 then INT. Transfer source address DEC mode................................. for memory to I/O (DMADn) (DMASn-) DMACn DMACn - 1 if DMACn = 0 then INT. Fixed address mode ......................................................... I/O to I/O (DMADn) (DMASn) DMACn DMACn - 1 if DMACn = 0 then INT. Counter mode................................................................... for interrupt counter DMASn DMASn + 1 DMACn DMACn - 1 if DMACn = 0 then INT.
Execution time (Min) at 20 MHz 16 states (1.6 s) 16 states (1.6 s) 16 states (1.6 s) 16 states (1.6 s) 16 states (1.6 s) 11 states (1.1 s)
0
0
1
Z
0
1
0
Z
0
1
1
Z
1
0
0
Z
1
0
1
1
(1 states = 100 ns at 20 MHz, High-frequency mode)
Note 1: n: Corresponds to micro DMA channels 0 to 3. DMADn+/DMASn+: Post-increment (Increments register value after transfer.) DMADn-/DMASn-: Post-decrement (Decrement register value after transfer.) Note 2: Execution time: When setting source address/destination address area to 16-bit bus, 0 waits. Clock condition: fc = 20 MHz, clock gear: 1 (fc) Note 3: Do not use the codes other than the above mentioned codes for transfer mode register.
93CS44-42
2004-02-10
TMP93CS44/S45 3.4.3 Interrupt Controller
Figure 3.4.4 is a block diagram of the interrupt circuits. The left half of the diagram shows the interrupt controller; the right half includes the CPU interrupt request signal circuit and the halt release signal circuit. Each interrupt channel (Total of 24 channels) in the interrupt controller has an interrupt request flip-flop, interrupt priority setting register, and a register for storing the micro DMA start vector. The interrupt request fip-flop is used to latch interrupt requests from peripheral devices. The flip-flop is cleared to 0 at reset, when the CPU reads the interrupt channel vector after the acceptance of interrupt, or when the CPU executes an instruction that clears the interrupt of that channel (Writes 0 in the clear bit of the interrupt priority setting register). For example, to clear the INT0 interrupt request, set the register after the DI instruction as follows.
INTE0AD - - - - 0 - - - B
The status of the interrupt request flip-flop is detected by reading the clear bit. Detects whether there is an interrupt request for an interrupt channel. The interrupt priority can be set by writing the priority in the interrupt priority setting register (e.g., INTE0AD, INTE45 etc.) provided for each interrupt source. Interrupt levels to be set are from 1 to 6. Writing 0 or 7 as the interrupt priority disables the corresponding interrupt request. The priority of the non-maskable interrupt ( NMI pin, watchdog timer etc.) is fixed to 7. If interrupt requests with the same interrupt level are generated simultaneously, interrupts are accepted in accordance with the default priority (the smaller the vector value, the higher the priority). The interrupt controller sends the interrupt request with the highest priority among the simultaneous interrupts and its vector address to the CPU. The CPU compares the priority value set in the status register by the interrupt request signal with the priority value sent; if the latter is higher, the interrupt is accepted. Then the CPU sets a value higher than the priority value by 1 in the CPU SR. Interrupt requests where the priority value equals or is higher than the set value are accepted simultaneously during the previous interrupt routine. When interrupt processing is completed (after execution of the RETI instruction) , the CPU restores the priority value saved in the stack before the interrupt was generated to the CPU SR. The interrupt controller also has four registers used to store the micro DMA start vector. These are I/O registers; unlike other micro DMA registers (DMAS, DMAD, DMAM, and DMAC). Writing the start vector of the interrupt source for the micro DMA processing (See Table 3.4.1), enables the corresponding interrupt to be processed by micro DMA processing. The values must be set in the micro DMA parameter registers (e.g., DMAS and DMAD) prior to the micro DMA processing.
93CS44-43
2004-02-10
Interrupt controller Interrupt request flip-flop S Q 1 Interrupt request signal to CPU IFF<2:0> 1 7 INTRQ2 to 0 3 Interrupt vector read D0 D1 24 D2 D3 Interrupt vector generation D4 D5 D6 If INTRQ2 to 0 IFF2 to 0 then 1. 3 3 6 Interrupt enable flag on CPU side RESET RESET R Interrupt vecror V read
CPU
NMI
INTWD Interrupt level detect
EI 1 to EI 7 DI Interrupt request signal
Priority setting register Dn Dn + 1 D Q Dn + 2 CLR Interrupt request F/F S Q Dn + 3 (Highese priority = 7)
RESET
V = 20H V = 24H Decoder Y1 A Y2 Y3 B Y4 C Y5 Y6 6 Priority encoder 1 2 A 3 Highest B priority C 4 interrupt 5 level select 6 7
INT0 R
Interrupt request flip-flop read
During IDLE1 During STOP
Figure 3.4.4 Block Diagram of Interrupt Controller
93CS44-44
5
Micro DMA start vector setting register
Halt release RESET INT0 NMI
INT1 INT4 INT5 INT6 INT7 INTT0 INTT1 INTT2 INTT3 INTTR4 INTTR5 INTTR6 INTTR7 INTTO4 INTTO5 INTRX0 INTTX0 INTRX1 INTTX1 INTAD INTS2 4 5 5 Match detect 4 input OR
Interrupt request clear Dn + 3 Interrupt request V read V = 28H V = 2CH V = 30H V = 34H V = 38H V = 3CH V = 40H V = 44H V = 48H V = 4CH V = 50H V = 54H V = 58H V = 5CH V = 60H V = 64H V = 68H V = 6CH V = 70H V = 74H V = 78H V = 7CH
Micro DMA request
TMP93CS44/S45
D4 D3 D Q D2 D1 CLR D0 RESET
2 DMA0V DMA1V DMA2V DMA3V
0 A 1 2 B 3 Micro DMA channel priorty encoder
2004-02-10
2
Micro DMA channel specification
TMP93CS44/S45
(1) Interrupt priority setting register
Symbol INTE0AD Address 0070H 7 IADC R/W 0 I5C R/W 0 I7C R/W 0 IT1C R/W 0 IT3C R/W 0 IT5C R/W 0 IT7C R/W 0 ITO5C R/W 0 ITX0C R/W 0 ITX1C R/W 0 I1C R/W 0 5 INTAD IADM2 IADM1 W 0 0 INT5 I5M2 I5M1 W 0 0 INT7 I7M2 I7M1 W 0 0 INTT1 (Timer 1) IT1M2 IT1M1 W 0 0 INTT3 (Timer 3) IT3M2 IT3M1 W 0 0 INTTR5 (TREG5) IT5M2 IT5M1 W 0 INTTR7 (TREG7) IT7M2 IT7M1 W 0 0 INTTO5 ITO5M2 ITO5M1 W 0 0 INTTX0 ITX0M2 ITX0M1 W 0 0 INTTX1 ITX1M2 ITX1M1 W 0 0 INT1 I1M2 I1M1 W 0 0 6 4 IADM0 0 I5M0 0 I7M0 0 IT1M0 0 IT3M0 0 IT5M0 0 IT7M0 0 ITO5M0 0 ITX0M0 0 ITX1M0 0 I1M0 0 3 I0C R/W 0 I4C R/W 0 I6C R/W 0 IT0C R/W 0 IT2C R/W 0 IT4C R/W 0 IT6C R/W 0 ITO4C R/W 0 IRX0C R/W 0 IRX1C R/W 0 IS2C R/W 0
(Prohibit read-modify-write)
2 INT0 I0M2 0 INT4 I4M2 0 INT6 I6M1 W 0 0 INTT0 (Timer 0) IT0M2 IT0M1 W 0 0 INTT2 (Timer 2) IT2M2 IT2M1 W 0 0 INTTR4 (TREG4) IT4M2 IT4M1 W 0 0 INTTR6 (TREG6) IT6M2 IT6M1 W 0 0 INTTO4 ITO4M2 ITO4M1 W 0 0 INTRX0 IRX0M2 IRX0M1 W 0 0 INTRX1 IRX1M2 IRX1M1 W 0 0 INTS2 IS2M2 IS2M1 W 0 0 I6M2 I6M0 0 IT0M0 0 IT2M0 0 IT4M0 0 IT6M0 0 ITO4M0 0 IRX0M0 0 IRX1M0 0 IS2M0 0 I4M1 W 0 I4M0 0 I0M1 W 0 I0M0 0 1 0 Interrupt source Bit symbol Read/Write After reset
INTE45
0071H
INTE67
0072H
INTET10
0073H
INTET32
0074H
INTET54
0075H
INTET76
0076H
INTEO54
0077H
INTES0
0078H
INTES1
0079H
INTE1S2
007AH
IxxM2 0 0 0 0 1 1 1 1 IxxC 0 1
IxxM1 0 0 1 1 0 0 1 1
IxxM0 0 1 0 1 0 1 0 1
Function (Write) Prohibits interrupt request. Sets interrupt request level to 1. Sets interrupt request level to 2. Sets interrupt request level to 3. Sets interrupt request level to 4. Sets interrupt request level to 5. Sets interrupt request level to 6. Prohibits interrupt request. Function (Write) Clears interrupt request flag. Don't care
Function (Read) Indicates no interrupt request. Indicates interrupt request.
Note 1: Read-modify-write is prohibited. Note 2: Note about clearing interrupt request flag The interrupt request flag of INTRX0, INTRX1 are not cleared by writing "00" to IXXC because of they are level interrupts. They can be cleared only by resetting or reading SCBUFn. Figure 3.4.5 Interrupt Priority Setting Register
93CS44-45
2004-02-10
TMP93CS44/S45
(2) External interrupt control Interrupt Input Mode Control Register 7
IIMC (007BH) Bit symbol Read/Write After reset Function Prohibit readmodifywrite
6
5
- W 0 Always write "0".
4
3
2
I0IE 0
1: INT0 input enable
1
I0LE W 0
0: INT0 edge mode 1: INT0 level mode
0
NMIREE 0
1: Can be accepted in NMI rising edge.
INT0 input enable (Note 1) 0 INT0 disable (P35 function only) 1 Input enable
NMI rising edge enable
0 1
Interrupt request generation at falling edge Interrupt request generation at rising/falling edge
Note 1:
The INT0 pin can also be used for standby release as described later. Even if the pin is not used for standby release, setting this register to "0" maintains the port function during standby mode. Case of changing from level to edge for INT0 pin mode ( "1" "0" ) Execution example: LD (INTE0AD) LD (IIMC) LD (INTE0AD) , xxxx0000B , xxxxx10xB , xxxx0nnnB
INT0 level enable (Note 2) 0 Rising edge detect interrupt 1 High level interrupt
Note 2:
; INT0 disable, clean the request flag. ; Change from level to edge. ; Set interrupt level "n" for INT0, clear the request flag.
Note 3: Note 4:
IIMC is always read as "1". See electrical characteristics in section 4 for external interrupt input pulse.
Figure 3.4.6 Interrupt Input Mode Control Register Table 3.4.2 Setting of External Interrupt Pin Functions Interrupt
NMI
Shared Pin
NMI
Mode
Falling edge
Setting method
IIMC = 0
(Dedicated pin)
Falling and rising IIMC = 1 edges Rising edge IIMC = 0, = 1 IIMC = 1, = 1 - T4MOD = 0, 0 or 0, 1 or 1, 1 T4MOD = 1, 0 - T5MOD = 0, 0 or 0, 1 or 1, 1 T5MOD = 1, 0 -
INT0
P35 Level
INT1
P40
Rising edge Rising edge
INT4
P42 Falling edge
INT5
P43
Rising edge Rising edge
INT6
P45 Falling edge
INT7
P46
Rising edge
93CS44-46
2004-02-10
TMP93CS44/S45
(3) Micro DMA start vector When the CPU reads the interrupt vector after accepting an interrupt, it simultaneously compares the interrupt vector (Bits 2 to 6 of the interrupt vector) with each channel's micro DMA start vector. When the two match, the interrupt from the channel whose value matched is processed in micro DMA mode. If the interrupt vector matches more than one channel, the channel with the lower channel number has a higher priority. Micro DMA0 Start Vector 7
DMA0V (007CH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0
6
5
4
DMA0V4
3
DMA0V3
2
DMA0V2 W 0
1
DMA0V1 0
0
DMA0V0 0
Micro DMA channel 0 processed by matching bits 2 to 6 of the interrupt vector.
Micro DMA1 Start Vector 7
DMA1V (007DH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0
6
5
4
DMA1V4
3
DMA1V3
2
DMA1V2 W 0
1
DMA1V1 0
0
DMA1V0 0
Micro DMA channel 1 processed by matching bits 2 to 6 of the interrupt vector.
Micro DMA2 Start Vector 7
DMA2V (007EH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0
6
5
4
DMA2V4
3
DMA2V3
2
DMA2V2 W 0
1
DMA2V1 0
0
DMA2V0 0
Micro DMA channel 2 processed by matching bits 2 to 6 of the interrupt vector.
Micro DMA3 Start Vector 7
DMA3V (007FH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0
6
5
4
DMA3V4
3
DMA3V3
2
DMA3V2 W 0
1
DMA3V1 0
0
DMA3V0 0
Micro DMA channel 3 processed by matching bits 2 to 6 of the interrupt vector.
Figure 3.4.7 Micro DMA Start Vector Register
93CS44-47
2004-02-10
TMP93CS44/S45
(4) Notes The instruction execution unit and the bus interface unit of this CPU operate independently of each other. Therefore, if the instruction used to clear an interrupt request flag of an interrupt is fetched before the interrupt is generated, it is possible that the CPU might execute the fetched instruction to clear the interrupt request flag while reading the interrupt vector after accepting the interrupt. To avoid the above occurring, clear the interrupt request flag by entering the instruction to clear the flag after the DI instruction. In the case of setting an interrupt enable again by EI instruction after the execution of clearing instruction, execute EI instruction after clearing instruction and following more than one instruction are executed. When EI instruction is placed immediately after clearing instruction, an interrupt becomes enable before interrupt request flags are cleared. In the case of changing the value of the interrupt mask register by execution of POP SR instruction, disable an interrupt by DI instruction before execution of POP SR instruction.
93CS44-48
2004-02-10
TMP93CS44/S45
3.5
Functions of Ports
The TMP93CS44 has 62 bits for I/O ports. The TMP93CS45 has 44 bits for I/O ports because Port 0, Port 1, P30, and P31 are dedicated pins for AD0 to AD7, AD8 to AD15 (or A8 to A15), RD , and WR . These port pins have I/O functions for the built-in CPU and internal I/Os as well as general-purpose I/O port functions. Table 3.5.1 lists the function of each port pin. Table 3.5.2 lists I/O registers and specification. Table 3.5.1 Functions of Ports
(PU = with programmable pull-up resistor)
Port Name
Port 0 Port 1 Port 2 Port 3
Pin Name
P00 to P07 P10 to P17 P20 to P27 P30 P31 P32 P33 P34 P35
Pin Number
8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 4 1 1 1 1 1 1 1 1 1 7
Direction
I/O I/O I/O Output Output I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O Input Input Input I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O
R
- - PU - - PU - - - - - - - - - - - - - - PU PU PU PU PU PU - - - -
Direction Setting Unit
Bit Bit Bit (fixed) (fixed) Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit (fixed) (fixed) (fixed) Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
Pin Name for Built-in Function
AD0 to AD7 AD8 to AD15/A8 to A15 A0 to A7/A16 to A23
RD
WR
HWR /SCK
SO/SDA SI/SCL INT0 TI0/INT1 TO3 TI4/INT4 TI5/INT5 TO4 TI6/INT6 TI7/INT7 TO6 AN0 to AN2 AN3/ ADTRG AN4 to AN7 TXD0 RXD0 SCLK0/ CTS0 TXD1 RXD1 SCLK1/ CTS1 XT1 XT2
WAIT (High current output)
Port 4
P40 P41 P42 P43 P44 P45 P46 P47
Port 5
P50 to P52 P53 P54 to P57
Port 6
P60 P61 P62 P63 P64 P65 P66 P67
Port 7
P70 P71 to P77
(High current output)
93CS44-49
2004-02-10
TMP93CS44/S45
Table 3.5.2 I/O Registers and Specification (1/2) Port
Port 0
Name
P00 to P07
Specification
Input port (Note 1) Output port (Note 1) AD0 to AD7 bus
I/O Register Pn
x x x x x x x 0 1 x 0 0 x 1 0 x x 0 1 x x x x x x x x x x x x x x x x x x x x x None 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 None None
PnCR
0 1 x 0 1 0 1 0 0 1 0 1
PnFC
None 0 0 1 1 0 0 0 1 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 x 0 1 None None 0 0 1
Port 1
P10 to P17
Input port (Note 1) Output port (Note1) AD8 to AD15 bus (Note 2) AD8 to AD15 output (Note 2)
Port 2
P20 to P27
Input port (without pull up) Input port (with pull up) Output port A0 to A7 output (Note 1) A16 to A23 output
Port 3
P30
Output port (Note 1) Outputs RD only when accessing external space Always outputs RD
P31
Output port (Note 1) Outputs WR only when accessing external space
P32
Input port SCK input (without pull up) Input port SCK input (with pull up) Output port
HWR output ( = 0)
SCK output ( = 1) P33 Input port Output port SDA I/O, SO output P34 Input port SI input Output port SCL I/O P35 Port 4 P40 P41 Input port/INT0 input (Note 3) Output port Input port/TI0/INT Output port Input port Output port TO3 output P42 P43 Input port/TI4/INT4 input Output port Input port/TI5/INT5 input Output port
X: Don't care, n: Port number Note 1: In the TMP93CS45, these functions are not available. Note 2: In the TMP93CS45, these functions are fixed depending on the value of the AM8/ AM16 pin. Note 3: Using P35 pin as INT0, IIMC register has to be set enable interrupt.
93CS44-50
2004-02-10
TMP93CS44/S45
Table 3.5.2 I/O Registers and Specification (2/2) Port
Port 4
Name
P44 Input port Output port TO4 output P45 P46 P47
Specification
I/O Register Pn
x x x x x x x x x x x x 0 1 x x 0 1 x 0 1 x x 0 1 x x 0 1 x 0 1 x x x x x x x x x 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1 0 1 None None 0 0 0 1 None 0 0 0 1 0 0 0 1 None
PnCR
0 1 1 0 1 0 1 0 1 1
PnFC
0 0 1
Input port/TI6/INT6 input Output port Input port/TI7/INT7 input Output port Input port Output port TO6 output
None
0 0 1 None 0 0 0 1
Port 5 Port 6
P50 to P57 P60
Input port AN0 to AN7 input (Note 4) Input port (without pull up) Input port (with pull up) Output port TXD0 output
P61
Input port/RXD0 input (without pull up) Input port/RXD0 input (with pull up) Output port
P62
Input port/SCLK0/ CTS0 input (without pull up) Input port/SCLK0/ CTS0 input (with pull up) Output port SCLK0 output
P63
Input port (without pull up) Input port (with pull up) Output port TXD1 output (Note 3)
P64
Input port/RXD1 input (without pull up) Input port/RXD1 input (with pull up) Output port
P65
Input port/SCLK1/ CTS1 input (without pull up) Input port/SCLK1/ CTS1 input (with pull up) Output port SCLK1 output
P66, P67
Input port Output port (Note 5) XT1/2 (Note 6)
Port 7
P70 P71 to P77
Input port/ WAIT input Output port Input port Output port
X: Don't care, n: Port number Note 4: Using P50 to P57 pins as input channels for the AD converter, the channels are selected by ADMOD1. Note 5: Using P66 and P67 pins as the output ports, output is through the open-drain buffer. Note 6: Using P66 and P67 pins as the XT1 to XT2, oscillation is enabled by the SYSCR0 register.
93CS44-51
2004-02-10
TMP93CS44/S45
Resetting makes the port pins listed below function as general-purpose I/O ports. I/O pins programmable for input or output are set to input ports except P66/XT1, P67/XT2. To set port pins for built-in functions, a program is required. Since the TMP93CS45 needs external ROMs, some ports are permanently assigned for memory interface. * * P00 to P07 P10 to P17 AD0 to AD7 AD8 to AD15 (or A8 to A15) * * P30 P31
RD WR
93CS44-52
2004-02-10
TMP93CS44/S45
3.5
3.5.1
Port 0 (P00 to P07)
Port 0 is an 8-bit general-purpose I/O port. I/O can be set on a bit basis using the control register P0CR. Resetting sets all bits of P0CR to 0 and sets port 0 to input mode. Figure 3.5.3 shows the registers for port 0. In addition to functioning as a general-purpose I/O port, port 0 also shares functions as an address data bus (AD0 to AD7). To access external memory, port 0 functions as an address data bus (AD0 to AD7) and all bits of the control register P0CR are set to 0. With the TMP93CS45, which needs external ROMs, port 0 always functions as an address data bus (AD0 to AD7) regardless of the value set in control register P0CR.
Reset
Direction control (on bit basis)
P0CR write Internal data bus
Output latch Output buffer P0 write
Port 0 P00 to P07 (AD0 to AD7) S
S B Selector A P0 read B Selector A
Figure 3.5.1 Port 0
93CS44-53
2004-02-10
TMP93CS44/S45 3.5.2 Port 1 (P10 to P17)
Port 1 is an 8-bit general-purpose I/O port. I/O can be set on a bit basis using control register P1CR and function register P1FC. Resetting sets all bits of output latch P1, control register P1CR, and function register P1FC to 0 and sets port 1 to input mode. Figure 3.5.3 shows the registers for port 1. In addition to functioning as a general-purpose I/O port, port 1 also shares functions as an address data bus (AD8 to AD15) or an address bus (A8 to A15). With the TMP93CS45, which needs external ROMs, port 1 always functions as an address data bus (AD8 to AD15) (the case of AM8/ AM16 = 0), as an address bus (A8 to A15) (the case of AM8/ AM16 = 1) regardless of the value set in control register P1CR.
Reset
Direction control (on bit basis)
P1CR write Internal data bus
Function control (on bit basis) P1FC write
Output latch Output buffer P1 write S B Selector A P1 read
Port 1 P10 to P17 (AD8 to AD15/A8 to A15)
Figure 3.5.2 Port 1
93CS44-54
2004-02-10
TMP93CS44/S45
Port 0 Register 7
P0 (0000H) Bit symbol Read/Write After reset P07
6
P06
5
P05
4
P04 R/W
3
P03
2
P02
1
P01
0
P00
Input mode (Output latch register becomes undefined.)
Port 0 Control Register 7
P0CR (0002H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 P07C
6
P06C
5
P05C
4
P04C W
3
P03C 0
2
P02C 0
1
P01C 0
0
P00C 0
0: Input 1: Output (at external access, port 0 becomes AD7 to AD0 and P0CR is set to "0".) Port 0 I/O setting 0 Input 1 Output
Port 1 Register 7
P1 (0001H) Bit symbol Read/Write After reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Input mode (Output latch register is set to "0".)
Port 1 Control Register 7
P1CR (0004H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 P17C
6
P16C
5
P15C
4
P14C W
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
<>
Port 1 Function Register 7
P1FC (0005H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 01: Output P1FC/P1CR = 00: Input P17F
6
P16F
5
P15F
4
P14F W
3
P13F 0
2
P12F 0
1
P11F 0 11: A15 to A8
0
P10F 0
10: AD15 to AD8
Port 1 function setting P1FC P1CR 0 1 0 1 Address data bus (AD15 to AD8) Address bus (A15 to A8)
Input port Output port
Note: is bit X in register P1FC; , in register P1CR.
Figure 3.5.3 Registers for Port 0 and Port 1
93CS44-55
2004-02-10
TMP93CS44/S45 3.5.3 Port 2 (P20 to P27)
Port 2 is an 8-bit general-purpose I/O port. I/O can be set on bit basis using the control register P2CR and function register P2FC. All bits of the output latch P2 is set to 1 by reset, and all bits of P2CR and P2FC are cleared to 0. Port 2 becomes the input mode with the pull-up resistor. In addition to functioning as a general-purpose I/O port, port 2 also shares functions as an address data bus (A0 to A7) and an address bus (A16 to A23). Using port 2 as address bus (A0 to A7 or A16 to A23), write 0 to output latches and be off the programmable pull-up resistor.
A16 to A23 B Selector A0 to A7 Reset A S
Direction control (on bit basis)
P2CR write Internal data bus
Function control (on bit basis) S P2FC write B Selector Output latch A Output buffer
P-ch Programmable pull up Port 2 P20 to P27 (A0 to A7/A16 to A23)
P2 write
S B Selector A
P2 read
Figure 3.5.4 Port 2
93CS44-56
2004-02-10
TMP93CS44/S45
Port 2 Register 7
P2 (0006H) Bit symbol Read/Write After reset Note 1: P27
6
P26
5
P25
4
P24 R/W
3
P23
2
P22
1
P21
0
P20
Input mode (Output latch register is set to "1".)
When port 2 is used in the input mode, P2 register controls the built-in pull-up resistor. Read-modify-write is prohibited in the input mode or the I/O mode. Setting the built-in pull-up resistor may be depended on the states of the input pin.
Port 2 Control Register 7
P2CR (0008H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 P27C
6
P26C
5
P25C
4
P24C W
3
P23C 0
2
P22C 0
1
P21C 0
0
P20C 0
<>
Port 2 Function Register 7
P2FC (0009H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 01: Output P2FC/P2CR = 00: Input P27F
6
P26F
5
P25F
4
P24F W
3
P23F 0 10: A7 to A0
2
P22F 0
1
P21F 0 11: A23 to A16
0
P20F 0
Port 2 function setting
P2FC P2CR
0 Input port Output port
1 Address bus (A7 to A0) Address bus (A23 to A16)
0 1
Note 2:
is bit X in register P2FC; , in register P2CR. To set as an address bus A23 to A16, set P2FC after setting P2CR.
Figure 3.5.5 Registers for Port 2
93CS44-57
2004-02-10
TMP93CS44/S45 3.5.4 Port 3 (P30 to P35)
Port 3 is an 6-bit general-purpose I/O port. I/O can be set on a bit basis, but note that P30 and P31 are used for output only. I/O is set using control register P3CR and function register P3FC. Resetting sets all bits of output latch P3 to 1. All bits of control register P3CR (bits 0 and 1 are unused), and function register P3FC are set to 0. Resetting also outputs 1 from P30 and P31. In addition to functioning as a general-purpose I/O port, port 3 also shares functions as an I/O for the CPU's control/status signal and serial bus interface. With the TMP93CS44, when P30 pin is defined as RD signal output mode ( = 1), setting the output latch register to 0 outputs the RD strobe (Used for the pseudo static RAM) from the P30 pin even when the internal address area is accessed. If the output latch register remains 1, the RD strobe signal is output only when the external address area is accessed. When P33 and P34 are used as the serial bus interface I/O pins in I2C bus mode (P3FC = 11), set open drain outputs (ODE = 11). With the TMP93CS45, which needs external ROMs, P30 outputs the RD signal; P31, the WR signal, regardless of the values set in function registers and . The RD signal is output not only when the external address area is accessed at = 1 but also the internal address area is accessed at = 0.
93CS44-58
2004-02-10
TMP93CS44/S45
(1) P30 ( RD ), P31 ( WR )
Reset for TMP93CS45 Function control (on bit basis) Internal data bus
P3FC write
S Output latch P3 write
S A Selector Output buffer B
RD , WR
P30 ( RD ) P31 ( WR )
P3 read
(2) P32 ( HWR /SCK)
Reset
Direction control (on bit basis)
P3CR write
Function control (on bit basis) P3FC write Internal data bus
Function control (on bit basis) P3FC write S Output latch
HWR
P-ch Programmable pull up S A S A Selector SCK S B B Selector B Output buffer P32 ( HWR /SCK)
P3 write
Selector P3 read SCK A
Figure 3.5.6 Port 3 (P30, P31, P32)
93CS44-59
2004-02-10
TMP93CS44/S45
(3) P33 (SDA/SO), P34 (SCL/SI)
Reset
Direction control (on bit basis) P3CR write
Function control (on bit basis) Internal data bus P3FC write
S Output latch A
S Selector P33 (SDA/SO) P34 (SCL/SI)
P3 write SDA/SO out SCL out
B S B Selector
Open-drain possible ODE
P3 read SDA in SCL/SI in
A
Figure 3.5.7 Port 3 (P33 and P34) (4) P35 (INT0) Port 35 is a general-purpose I/O port, and also used as an INT0 pin for external interrupt request input.
Reset
Direction control (on bit basis)
P3CR write Internal data bus
S Output latch
P35 (INT0)
P3 write S B Selector A Level/edge detect IIMC IIMC
P3 read INT0 interrupt
Figure 3.5.8 Port 3 (P35)
93CS44-60
2004-02-10
TMP93CS44/S45
Port 3 Register 7
P3 (0007H) Bit symbol Read/Write After reset Function Note 1: 1 1 Input mode 1
6
5
P35
4
P34
3
P33 R/W
2
P32 1
Input mode (pulled up)
1
P31 1
0
P30 1
Output mode
When port 32 is used in the input mode, P3 register controls the built-in pull-up resistor. Read-modify-write is prohibited in the input mode or the I/O mode. Setting the built-in pull-up resistor may be depended on the states of the input pin.
Port 3 Control Register 7
P3CR (000AH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0: Input
6
5
P35C
4
P34C W
3
P33C 0 1: Output
2
P32C 0
1
0
I/O setting 0 Input 1 Output
Port 3 Function Register 7
P3FC (000BH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
P32M W 0 0: HWR 1: SCK
5
4
P34F 0 0: Port 1: SCL/SI
3
P33F 0
2
P32F W 0
1
P31F 0 0: Port 1: WR
0
P30F 0 0: Port 1: RD
0: Port 0: Port 1: SDA/SO 1: P32M
P34 function setting (Note 2) 0 1 0 1 Input port Input SI Output port I/O SCL
P31 ( RD ) function setting 0 0 "0" output Always RD output (for pseudo SRAM)
1
"1" output
RD output only for external access
P33 function setting (Note 2) 0 1 Note 2: When P33 and P34 are used as the serial bus interface I/O pins in I2C bus mode (P3FC = 11), set open-drain outputs (ODE = 11). 1 P32 function setting 0 0 Port Output " HWR " Input/output "SCK" 0 1 Input port Don't set Output port I/O SDA/ Output SO
1
P31 ( WR ) function setting 0 0 1 "0" output access
1
"1" output
WR output only for external
1
Figure 3.5.9 Registers for Port 3
93CS44-61
2004-02-10
TMP93CS44/S45 3.5.5 Port 4 (P40 to P47)
Port 4 is a 8-bit general-purpose I/O port. I/O can be set on bit basis. Resetting sets port 4 to the input port. In addition to functioning as a general-purpose I/O port, port 4 also shares functions as an input for 8-bit timer 0 clock, 16-bit timer 4 and 5 clocks, an output for 8-bit timer F/F 3, 16-bit timer F/F 4 and 6 output. Writing 1 in the corresponding bit of the port 4 function register (P4FC) enables output of the timer. (1) P40 and P41
Reset
Direction control (on bit basis)
P4CR write S Output latch P40 (TI0/INT1) S B Selector A
P4 write
P4 read TI0, INT1 Reset Internal data bus
Direction control (on bit basis)
P4CR write
Function control (on bit basis) P4FC write S Output latch S A Selector B B Selector A S
P4 write Timer F/F OUT (TO3: Timer 3)
P41 (TO3)
P4 read
Figure 3.5.10 Port 4 (P40 and P41)
93CS44-62
2004-02-10
TMP93CS44/S45
(2) P42 to P47
Reset
Direction control (on bit basis)
P4CR write S Output latch P42 (TI4/INT4) P43 (TI5/INT5) P45 (TI6/INT6) P46 (TI7/INT7) S B Selector A
P4 write
P4 read TI4, INT4 TI5, INT5 TI6, INT6 TI7, INT7 Internal data bus
Reset
Direction control (on bit basis)
P4CR write
Function control (on bit basis) P4FC write S Output latch S A Selector B B Selector A S
P4 write Timer F/F OUT TO4: Timer 4 TO6: Timer 5
P44 (TO4) P47 (TO6)
P4 read
Figure 3.5.11 Port 4 (P42 to P47)
93CS44-63
2004-02-10
TMP93CS44/S45
Port 4 Register 7
P4 (000CH) Bit symbol Read/Write After reset 1 1 1 1 Input mode P47
6
P46
5
P45
4
P44 R/W
3
P43 1
2
P42 1
1
P41 1
0
P40 1
Port 4 Control Register 7
P4CR (000EH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 0: Input P47C
6
P46C
5
P45C
4
P44C W
3
P43C 0 1: Output
2
P42C 0
1
P41C 0
0
P40C 0
Port 4 I/O setting 0 Input 1 Output
Port 4 Function Register 7
P4FC (0010H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function P47F W 0 0: Port 1: TO6
6
5
4
P44F W 0 0: Port 1: TO4
3
2
1
P41F W 0 0: Port 1: TO3
0
Setting P41 as TO3 P4FC P4CR Setting P44 as TO4 P4FC P4CR Setting P47 as TO6 P4FC P4CR Note: P40/TI0, P42/TI4, P43/TI5, P45/TI6, P46/TI7 pin does not have a register changing port/function.
1 1
1 1
1 1
For example, when it is used as an input port, the input signal for port is inputted to 8- or 16-bit timer as a timer input.
Figure 3.5.12 Register for Port 4
93CS44-64
2004-02-10
TMP93CS44/S45 3.5.6 Port 5 (P50 to P57)
Port 5 is an 8-bit input port, also used as an analog input pin for the internal AD converter. Additionally, P53 is also used as an analog conversion external trigger input pin ( ADTRG ).
Port 5 Port 5 read P50 to P52 (AN0 to AN2) P53 (AN3/ ADTRG ) P54 to P57 (AN4 to AN7)
Internal data bus
Conversion result register AD read
AD converter
Channel selector
ADTRG
Only for P53 function
Figure 3.5.13 Port 5
Port 5 Register 7
P5 (000DH) Bit symbol Read/Write After reset P57
6
P56
5
P55
4
P54 R
3
P53
2
P52
1
P51
0
P50
Input mode
Figure 3.5.14 Register for Port 5 Note: The input channel selection of AD converter is set by AD converter mode register ADMOD1.
93CS44-65
2004-02-10
TMP93CS44/S45 3.5.7 Port 6 (P60 to P67)
* Ports 60 to 65 Ports 60 to 65 are a 6-bit general-purpose I/O port. I/Os can be set on a bit basis. Resetting sets P60 to P65 to an input port and connects a pull-up resistor. It also sets all bits of the output latch register to 1. In addition to functioning as a general-purpose I/O port, P60 to P65 can also share function as an I/O for serial channels 0 and 1. Writing "1" in the corresponding bit of the Port 6 function register (P6FC) enables this function. Resetting sets the function register value to 0 and sets all bits to input ports. * Port 66 and port 67 Port 66 and port 67 are a 2-bit general-purpose I/O port. I/Os can be set on a bit basis. The output buffer for P66, P67 is an open-drain type buffer. Resetting outputs high-impedance (High-Z) because output latch and control register are set to 1. In addition to functioning as a general-purpose I/O port, P66, P67 can also function as a low-frequency oscillator connecting pin (XT1, XT2) for dual clock mode. The dual clock function can be set by programming system clock control registers SYSCR0, SYSCR1. (1) Port 60 (TXD0) and port 63 (TXD1) Port 60 and port 63 also function as serial channel TXD output pins in addition to I/O ports. They have a programmable open-drain function.
Reset
Direction control (on bit basis)
P6CR write Internal data bus
Function control (on bit basis) P-ch Programmable pull up S A Selector B S B Selector A P60 (TXD0) P63 (TXD1)
P6FC write S Output latch
P6 write TXD0, TXD1
Open-drain possible ODE
P6 read
Figure 3.5.15 Ports 60 and 63
93CS44-66
2004-02-10
TMP93CS44/S45
(2) Port 61 (RXD0) and port 64 (RXD1) Port 61 and port 64 are I/O ports, and also used as RXD input pins for serial channels.
Reset
Direction control (on bit basis) Internal data bus P-ch Programmable pull up P61 (RXD0) P64 (RXD1) S B Selector A
P6CR write S Output latch
P6 write
P6 read RXD0, RXD1
Figure 3.5.16 Port 61 and Port 64 (3) Port 62 ( CTS0 /SCLK0) and port 65 ( CTS1 /SCLK1) Port 62 and port 65 are I/O ports, and also used as a CTS input pin and as a SCLK I/O pin for serial channels.
Reset
Direction control (on bit basis)
P6CR write Internal data bus
Function control (on bit basis) P6FC write S Output latch P-ch Programmable pull up S A Selector B S B Selector A P62 (SCLK0/ CTS0 ) P65 (SCLK1/ CTS1 )
P6 write
SCLK0 OUT SCLK1 OUT
P6 read
CTS0 , CTS1
SCLK0, SCLK1
Figure 3.5.17 Port 62 and Port 65
93CS44-67
2004-02-10
TMP93CS44/S45
(4) Port 66 (XT1) and port 67 (XT2) Port 66 and port 67 are general purpose I/O ports. It is also used as a low-frequency oscillator connecting pin.
Reset BUS6 S Direction control (on bit basis) P6CR write S Output latch Output buffer (Open-drain output) Low-frequency oscillation enable
BUS6
P66 (XT1)
P6 write S Internal data bus BUS6 B Selector A P6 read S Direction control (on bit basis) P6CR write S Output latch
(ON at "1")
BUS7
BUS7
P67 (XT2) Output buffer (Open-drain output) Low-frequency clock (fs)
P6 write S BUS7 B Selector A P6 read
Figure 3.5.18 Port 66 to Port 67
93CS44-68
2004-02-10
TMP93CS44/S45
Port 6 Register 7
P6 (0012H) Bit symbol Read/Write After reset 1 1 1 1 Output mode Note 1: P67
6
P66
5
P65
4
P64 R/W
3
P63 1
2
P62 1
1
P61 1
0
P60 1
Input mode
When P6 is used in the input mode, P6 register controls the built-in pull-up resistor. Read-modify-write is prohibited in the input mode or the I/O mode. Setting the built-in pull-up resistor may be depended on the states of the input pin.
Port 6 Control Register 7
P6CR (0014H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 1 1 0 0: Input 0 P67C
6
P66C
5
P65C
4
P64C W
3
P63C 0 1: Output
2
P62C 0
1
P61C 0
0
P60C 0
Note: Output buffer for port 66, 67 is an open-drain output type.
Port 6 I/O setting 0 Input 1 Output
Port 6 Function Register 7
P6FC (0016H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
5
P65F W 0 0: Port 1: SCLK1
4
3
P63F W 0 0: Port 1: TXD1
2
P62F 0 0: Port 1: SCLK0
1
0
P60F W 0 0: Port 1: TXD0
P63 TXD1 output setting (Note) P6FC 1 P6CR 1
P60 TXD0 output setting (Note) P6FC 1 P6CR 1
P65 SCLK1 output setting P6FC 1 P6CR 1
P62 SCLK0 output setting P6FC 1 P6CR 1
Note 2: To set the TXD pin to open drain, write "1" in bit0 (for TXD0 pin) or bit1 (for TXD1 pin) of the ODE register. P61/RXD0, P64/RXD1 pins do not have a register changing port/function. When using as input ports, the serial receive data is input to SIO. Note 3: Notes on using low-frequency oscillation circuit. To connect a low frequency resonator to port 66, 67, it is necessary to set the following procedures to reduce the consumption power supply. (Connecting to a resonator) Set P6CR = "11", P6 = "00" (Connecting to an oscillator) Set P6CR = "11", P6 = "10"
Figure 3.5.19 Register for Port 6
93CS44-69
2004-02-10
TMP93CS44/S45 3.5.8 Port 7 (P70 to P77)
Port 7 is an 8-bit general-purpose I/O port. I/O can be set on a bit basis. Port 7 can output large current and drive LED directly. In addition to I/O port, port 70 also shares functions as WAIT input pin. Resetting sets the function register P7CR to 0, and all bits to input ports. Port 7 as an input port. It also sets all bits of the output latch register P7 to 1. (1) P70 ( WAIT ) Port 70 is a general-purpose I/O port, and also used as an WAIT pin for external wait input.
Reset
Direction control (on bit basis) Internal data bus
P7CR write S Output latch P70 ( WAIT )
P7 write
S B Selector A
P7 read
WAIT
(2) P71 to P77
Reset
Direction control (on bit basis) Internal data bus
P7CR write S Output latch P71 to P77
P7 write
S B Selector A
P7 read
Figure 3.5.20 Port 7
93CS44-70
2004-02-10
TMP93CS44/S45
Port 7 Register 7
P7 (0013H) Bit symbol Read/Write After reset 1 1 1 1 P77
6
P76
5
P75
4
P74 R/W
3
P73 1
2
P72 1
1
P71 1
0
P70 1
Input mode
Port 7 Control Register 7
P7CR (0015H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0: Input 0 P77C
6
P76C
5
P75C
4
P74C W
3
P73C 0 1: Output
2
P72C 0
1
P71C 0
0
P70C 0
Port 7 I/O setting 0 Input 1 Output
Note:
P70/ WAIT pin does not have a register changing port/function. For example, when it is used as and input port, the input signal is inputted as WAIT input. When it is used as WAIT input pin, bit of bus width WAIT control register must be specified.
Figure 3.5.21 Register for Port 7
93CS44-71
2004-02-10
TMP93CS44/S45
3.6
Bus Width/Wait Controller and AM8/ AM16 Pin
TMP93CS44/S45 have a built-in controller used to control wait ( WAIT pin) and data bus size (8 or 16 bits) for any of the three block address areas. And AM8/ AM16 pin selects external data bus width for TMP93CS45.
3.6.1
AM8/ AM16 pin
(1) TMP93CS44 Set this pin to "H". After reset, the CPU accesses the internal ROM with 16-bit bus width. The bus width when the CPU accesses an external area is set by the bus width/wait control register (Described at 3.6.3) and the registers of Port 1. (The value 1 of this pin is ignored and the value set by register is active.) (2) TMP93CS45 1. With fixed external 16-bit data bus and external 16-bit data bus or 8-bit data bus is selectable Set this pin to "L". Port1, AD8 to AD15 and A8 to A15 pins are fixed to AD8 to AD15 functions. The values set in port 1 control register and port 1 function register are invalid. The external data bus width is set by the bus width/wait control register which is described in section 3.6.3. It is necessary to set the program memory to be accessed to 16-bit data bus after reset. 2. With fixed external 8-bit data bus Set this pin to "H". Port1, AD8 to AD15 and A8 to A15 pins are fixed to A8 to A15 functions. The values set in port 1 control register and port 1 function register are invalid. The values of bit4: , , and , in the bus width/wait control register described in section 3.6.3 are invalid. The external 8-bit data bus is fixed.
93CS44-72
2004-02-10
TMP93CS44/S45 3.6.2 Address/Data Bus Pins
Port 0/AD0 to AD7, port 1/AD8 to AD15/A8 to A15 and port 2/A16 to A23/A0 to A7 function as address/data bus for connecting the external memories and so on. (1)
Products
(2)
(3)
(4)
TMP93CS45F (Note 4)
TMP93CS44F (Note 2), (Note 3) Max 8 (to 256 bytes) 16 0 VIH
Number of Address Bus Max 24 (to 16 Mbytes) Max 24 (to 16 Mbytes) Max 16 (to 64 Kbytes) Pins Number of Data Bus Pins Number of Multiplexed Pins
EA
8 8 VIL VIH AD0 to AD7 A8 to A15 A16 to A23
A23 to 8 AD7 to 0 A23 to 8
A7 to 0 D7 to 0
16 16
8 0
Mode Pins
AM8/ AM16 Port 0 Port 1 Port 2
VIL AD0 to AD7 AD8 to AD15 A16 to A23
A23 to 16
VIH AD0 to AD7 A8 to A15 A0 to A7
A15 to 0 AD7 to 0 ALE A15 to 0
(Note 1) A7 to 0 D7 to 0
Port Function
AD0 to AD7 AD8 to AD15 A0 to A7
A7 to 0 AD15 to 0 ALE A7 to 0
(Note 1) A15 to 0 D15 to 0
A23 to 16
A15 to 0 D15 to 0
AD15 to 0
Timing Chart
ALE ALE
RD
RD
RD
RD
Note 1: In case of (3) and (4), the data bus signals output the addresses since the signals are also used as the address bus. Writing "0" to bit CKOCR, ALE signal can be stopped outputting. Note 2: After reset operation, port 0, port 1 and port 2 of TMP93CS44F function as input ports. Note 3: In case of TMP93CS44F, all (1) to (4) can be available using P1CR, P1FC, P2CR and P2FC registers. Note 4: In case of TMP93CS45F, case (3) and (4) cannot be available.
93CS44-73
2004-02-10
TMP93CS44/S45 3.6.3 Bus Width/Wait Control Registers
Figure 3.6.1 shows control registers. One block address areas are controlled by 1-byte bus width/wait control registers (WAITC0, WAITC1, WAITC2). (1) Data bus size select Bit4 (, , ) of the control register is used to specify data bus size. Setting this bit to 0 accesses the memory in 16-bit data bus mode; setting it to 1 accesses the memory in 8-bit data bus mode. Changing data bus size depending on the access address is called dynamic bus sizing. Table 3.6.1 shows the details of the bus operation. This bit is changed by the state of AM8/ AM16 pin. (2) Wait control Control register bits 3 and 2 (, , ) are used to specify the number of waits. These bits execute the following operation by setting. "00" "01" "10" "11" A 2-state wait is inserted regardless of the WAIT pin status. A 1-state wait is inserted regardless of the WAIT pin status. A 1-state wait is inserted and the WAIT pin status is sampled. If the pin is low, inserting the wait maintains the bus cycle until the pin goes high. The bus cycle is completed without a wait (0 waits) regardless of the WAIT pin status.
These bits are initialized to 00 by reset. (3) Address area specification Control register bits 1 and 0 (, , ) are used to specify the target address area. Setting these bits to 00 enables settings (Wait state, bus size etc.) as follows: * * * WAITC0 setting enabled when 7F00H to 7FFFH is accessed. WAITC1 setting enabled when 880H to 7FFFH is accessed. WAITC2 setting enabled when 8000H to 3FFFFFH is accessed.
Setting bits to 01 enables setting for each block when 400000H to 7FFFFFH is accessed. Setting bits to 10 enables them 800000H to BFFFFFH is accessed. Setting bits to 11 enables them when C00000H to FFFFFFH is accessed.
93CS44-74
2004-02-10
TMP93CS44/S45
7
WAITC0 (0068H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
5
4
B0BUS 0 0: 16-bit bus 1: 8-bit bus B1BUS 0 0: 16-bit bus 1: 8-bit bus B2BUS 0
3
B0W1 0 00: 2 waits 01: 1 wait 10: (1 + N) waits 11: 0 waits B1W1 0 00: 2 waits 01: 1 wait 10: (1 + N) waits 11: 0 waits B2W1 0
2
B0W0 W 0 00: 01: 10: 11:
1
B0C1 0
0
B0C0 0
7F00H to 7FFFH From 400000H From 800000H From C00000H B1C0 0
WAITC1 (0069H) Prohibit readmodifywrite
Bit symbol Read/Write After reset Function
B1W0 W 0
B1C1 0 00: 01: 10: 11:
880H to 7FFFH From 400000H From 800000H From C00000H B2C0 0
WAITC2 (006AH) Prohibit readmodifywrite
Bit symbol Read/Write After reset Function
B2W0 W 0
B2C1 0 00: 01: 10: 11:
0: 16-bit 00: 2 waits bus 01: 1wait 1: 8-bit bus 10: (1 + N) waits 11: 0 waits
From 8000H From 400000H From 800000H From C00000H
Figure 3.6.1 Bus Width/Wait Control Registers Table 3.6.1 Dynamic Bus Sizing Operand Start Memory CPU Data CPU Address Address Data Size D15 to D8 D7 to D0
2n + 0 (Even number) 2n + 1 (Odd number) 16 bits 2n + 0 (Even number) 2n + 1 (Odd number) 8 bits 16 bits 8 bits 16 bits 8 bits 16 bits 8 bits 16 bits 32 bits 2n + 0 (Even number) 8 bits 2n + 0 2n + 0 2n + 1 2n + 1 2n + 0 2n + 1 2n + 0 2n + 1 2n + 2 2n + 1 2n + 2 2n + 0 2n + 1 2n + 2 2n + 3 16 bits 2n + 1 (Odd number) 8 bits 2n + 0 2n + 2 2n + 1 2n + 2 2n + 3 2n + 4 16 bits 2n + 1 2n + 2 2n + 4 xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx b15 to b8 xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 b31 to b24 xxxxx xxxxx xxxxx xxxxx b7 to b0 b23 to b16 xxxxx b7 to b0 b7 to b0 b7 to b0 xxxxx b7 to b0 b15 to b8 b7 to b0 b7 to b0 b15 to b8 xxxxx b15 to b8 b7 to b0 b15 to b8 b23 to b16 b31 to b24 b7 to b0 b23 to b16 b7 to b0 b15 to b8 b23 to b16 b31 to b24 xxxxx b15 to b8 b31 to b24
Operand Data Size
8 bits
xxxxx: During a read, data input to the bus is ignored. At write, the bus is at high impedance and the write strobe signal remains non-active.
93CS44-75
2004-02-10
TMP93CS44/S45 3.6.4 Bus Width/Wait Control
An image of the actual bus width/wait control is shown below. Out of the whole memory area, address areas that can be specified are divided into four parts. Addresses from 000000H to 3FFFFFH are divided differently: 7F00H to 7FFFH is specified for WAITC0; 880H to 7FFFH, for WAITC1; and 8000H to 3FFFFFH, for WAITC2. The reason is that a device other than ROM (e.g., RAM or I/O) might be connected externally. 7F00H to 7FFFH (256 bytes) for WAITC0 are mapped mainly for possible expansions to external I/O. 880H to 7FFFH (approx. 31 Kbytes) for WAITC1 are mapped there mainly for possible extensions to external RAM. 8000H to 3FFFFFH (approx. 4 Mbytes) for WAITC2 are mapped mainly for possible extensions to external ROM. With the TMP93CS45, which does not have a built-in ROM, the program is externally read at address FF0000H in this setting (16-bit bus, 2 waits). With the TMP93CS44 which has a built-in ROM, addresses from FF0000H to FFFFFFH are used as the internal ROM area; WAITC2 is disabled in this area. After reset, the CPU reads the program from the built-in ROM in 16-bit bus, 0 WAIT mode.
WAITC0 000000H 7F00H 8000H 400000H = 01 800000H = 10 C00000H = 11 FFFFFFH (Mainly for I/O) (Mainly for RAM) (Mainly for ROM) = 11 = 11 = 10 = 10 = 01 = 01 880H = 00 WAITC1 = 00 = 01 WAITC2
Note 1: Access priority is highest for built-in I/O, then built-in memory, and lowest for the bus width/wait controller. Note 2: External areas other than WAITC0 to WAITC2 are accessed in 0 WAIT mode. In the TMP93CS45, when the AM8/ AM16 pin is set to "L", the data bus width is fixed to 16-bit. When the AM8/ AM16 pin is set to "H", it is fixed to 8 bits. In the TMP93CS44, the data bus width is always fixed to 16 bits. When using the bus width/wait controller, do not specify the same address area more than once. (However, when addresses 7F00H to 7FFFH for WAITC0 and 880H to 7FFFH for WAITC1 are specified, in other words, specifications overlap, only the WAITC0 setting is active.)
93CS44-76
2004-02-10
TMP93CS44/S45 3.6.5 Example of Usage
(1) Example of usage-1 Figure 3.6.2 is an example in which an external memory is connected to the TMP93CS45. In this example, a ROM is connected using 16-bit bus; a RAM is connected using 8-bit bus.
Decoder IOCS RAMCS ROMCS
74HC573
D TMP93CS45 Upper Address D ALE AD8 to AD15 AD0 to AD7 LE LE
Q
Address bus
CS
CS
CS
CS
Q
OE
Upper byte ROM
OE
Lower byte ROM
8-bit bus RAM
OE WE
8-bit bus I/O
OE WE
EA
AM8/ AM16
RD WR
Figure 3.6.2 Example of External Memory Connection (ROM = 16 bits, RAM and I/O = 8 bits)
WAITC0 WAITC1 WAITC2 LD LD LD X: Don't care EQU EQU EQU (WAITC0), (WAITC1), (WAITC2), 68H 69H 6AH XXX10000B XXX11100B XXX00111B
; WAITC0 = 8 bits, 2 waits, 7F00H to 7FFFH. ; WAITC1 = 8 bits, 0 waits, 880H to 7EFFH. ; WAITC2 = 16 bits, 1 wait, C00000H to FFFFFFH.
93CS44-77
2004-02-10
TMP93CS44/S45
(1) Example of usage-2 Figure 3.6.3 is an example in which an external memory is connected to the TMP93CS45. In this example, a ROM, RAM, and I/O are connected using 8-bit bus.
Decoder IOCS RAMCS ROMCS
Address bus TMP93CS45 Upper Address ALE A8 to A15 AD0 to AD7 74HC573
CS CS CS
D LE
Q
OE
8-bit bus ROM
8-bit bus RAM
OE WE
8-bit bus I/O
OE WE
EA
AM8/ AM16
RD WR
Figure 3.6.3 Example of External Memory Connection (ROM, RAM and I/O = 8 bits)
WAITC0 WAITC1 WAITC2 LD LD LD EQU EQU EQU (WAITC0), (WAITC1), (WAITC2), 68H 69H 6AH XXX10000B XXX11100B XXX00111B
; WAITC0 = 8 bits, 2 waits, 7F00H to 7FFFH ; WAITC1 = 8 bits, 0 waits, 880H to 7EFFH ; WAITC2 = 8 bits, 1 wait, C00000H to FFFFFFH
X: Don't care
93CS44-78
2004-02-10
TMP93CS44/S45
(3) Example of usage-3 Figure 3.6.4 is an example in which an external memory is connected to the TMP93CS44. In this example, ROM 128 Kbytes are connected using 16-bit bus, and RAM 256 Kbytes are connected using 16-bit bus.
Decoder
ROMCS RAMCS
TMP93CS44 Upper address Latch x 16 AD8 to AD15 D AD0 to AD7 LE Q Address bus ROM (128 Kbytes x 16) D8 to D15 D0 to D7
OE CS
ALE
RAM (128 Kbytes x 8) I/O1 to I/O8
RD HWR
OE R/ W CS
Upper byte
WR
RAM (128 Kbytes x 8) I/O1 to I/O8
OE R/ W CS
AM8/ AM16
EA
Lower byte
Figure 3.6.4 Example of External Memory Connection (ROM and RAM = 16 bits) The TMP93CS44 has built-in ROM and RAM. When ROM and RAM have insufficient capacity, it is possible to connect an external memory as the example of the external memory connection. In this example, the memory configuration is as follows. Memory
ROM SRAM Internal Internal
Memory Size
64 Kbytes 2 Kbytes
Address
FF0000H to FFFFFFH 400000H to 41FFFFH 000080H to 00087FH 800000H to 83FFFFH
Data Bus
16 bits 16 bits 16 bits 16 bits
External 128 Kbytes External 256 Kbytes
93CS44-79
2004-02-10
TMP93CS44/S45
3.7
8-Bit Timers
TMP93CS44/S45 contains four 8-bit timers (Timer 0, 1, 2, 3), each of which can be operated independently. The cascade connection allows these timers to be used as 16-bit timer. The following four operating modes are provided for the 8-bit timers. * * * * 8-bit interval timer mode (4 timers) 16-bit interval timer mode (2 timers) 8-bit programmable square wave pulse generation (PPG: Variable duty with variable cycle) output mode (1 timer) 8-bit pulse width modulation (PWM: Variable duty with constant cycle) output mode (1 timer)
Figure 3.7.1 shows the block diagram of 8-bit timer (Timer 0, 1), and Figure 3.7.2 shows the block diagram of 8-bit timer (Timer 2, 3). Each interval timer consists of an 8-bit up counter, 8-bit comparator, and 8-bit timer register. Besides, timer flip-flops (TFF1, TFF3), are provided for pair of timer 0/1 and 2/3. Among the input clock sources for the interval timers, the internal clocks of T1, T4, T16, and T256 are obtained from the 9-bit prescaler shown in Figure 3.7.3. The operation modes and timer flip-flops of the 8-bit timer are controlled by five control registers T10MOD, T32MOD, TFFCR, TRUN and TRDC.
93CS44-80
2004-02-10
TRUN TRUN
Timer F/F control RUN Clear RUN Clear TFFCR, T10MOD TFF1 (Timer 4, 5)
Selector 2n - 1 over flow Selector T1 T16 T256
TI0 pin (External input) T1 T4 T16 8-bit up counter (UC0) 8-bit up counter (UC1) T10MOD T10MOD T10MOD
Figure 3.7.1 Block Diagram of 8-Bit Timers (Timer 0 and 1)
93CS44-81
8-bit comparator (CP0) Match detect INTT0 8-bit timer register TREG0 Internal data bus
8-bit comparator (CP1)
Match detect Selector T10MOD
8-bit timer register TREG1
INTT1
TMP93CS44/S45
2004-02-10
TRUN TRUN
Timer F/F control RUN Clear RUN Clear TFFCR, T32MOD TFF3 TO3 (Shared pin with P41)
T1 T4 T16 Selector 2n - 1 over flow Selector T1 T16 T256 8-bit up counter (UC2) 8-bit up counter (UC3)
T32MOD T32MOD T32MOD
Figure 3.7.2 Block Diagram of 8-Bit Timers (Timer 2 and 3)
93CS44-82
Match detect 8-bit comparator (CP2) INTT2 TO2TRG (to serial channels) Selector Register buffer TRDC Internal data bus 8-bit timer register TREG2
8-bit comparator (CP3)
Match detect Selector T32MOD
PPGTRG PWMTRG TREG-WR
8-bit timer register TREG3
INTT3
TMP93CS44/S45
2004-02-10
TMP93CS44/S45
1. Prescaler There are 9-bit prescaler and prescaler clock selection registers to generate input clock for 8-bit timer 0, 1, 2, 3, 16-bit timer 4, 5 and serial interface 0, 1. Figure 3.7.3 shows the block diagram. Table 3.7.1 shows prescaler clock resolution into 8, 16-bit timer.
/2 fFPH to CPU System clock (fSYS) 9-bit prescaler 2 4 8 16 32 64 128 256 512
Selector
/4
T1 T4 T16 T256 T1 T4 T16 1 T0 T2 T8 T32
to 8-bit timer 0, 1, 2, 3
XT1
fs
TRUN SYSCR1 Selector /2
Selector
SYSCR0 Run/stop and clear
to 16-bit timer 4, 5
to serial interface 0, 1
fc
fc/2
fc/4
fc/8 fc/16
X1
/2 /4 /8 /16
SYSCR1
Figure 3.7.3 The Block Diagram of Prescaler
Table 3.7.1 Prescaler Clock Resolution to 8- and 16-Bit Timer
at fc = 20 MHz, fs = 32.768 kHz
Select System Select Prescaler Clock Clock
1 (fs)
Gear Value
XXX 000 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16)
3
Prescaler Clock Resolution
T1
5
T4
7
T16 fs/2 (3.9 ms) fc/27 (6.4 s) fc/2 (12.8 s)
8 9 11
T256 fs/2 (62.5 ms) fc/211 (102.4 s) fc/212 (204.8 s) fc/213 (409.6 s) fc/214(819.2 s)
fs/2 (244 s) fs/2 (977 s) fc/23 (0.4 s) fc/2 (0.8 s)
4 5 6 7
fc/25 (1.6 s) fc/2 (3.2 s)
6 7 8 9
0 (fc)
00 (fFPH)
fc/2 (1.6 s) fc/2 (3.2 s) fc/2 (6.4 s)
fc/2 (6.4 s)
fc/2 (25.6 s)
10 11
fc/2 (12.8 s) fc/2 (51.2 s)
fc/2 (25.6 s) fc/2 (102.4 s) fc/215 (1.6384 ms) fs/27 (3.9 ms) fs/211 (62.5 ms)
XXX XXX
01 (Low-frequency clock) 10 (Note) (fc/16 clock) XXX: Don't care
XXX XXX
fs/23 (244 s) fs/25 (977 s) fs/27 (6.4 s)
fc/29 (25.6 s) fc/211 (102.4 s) fc/215 (1.6384 ms)
Note: The fc/16 clock as a prescaler clock can not be used when the fs is used as a system clock.
93CS44-83
2004-02-10
TMP93CS44/S45
The clock selected among fFPH clock, fc/16 clock, and fs clock is divided by 4 and input to this prescaler. This is selected by prescaler clock selection register SYSCR0. Resetting sets to "00", therefore fFPH/4 clock is input. The 8-bit timer selects between 4 clock inputs: T1, T4, T16, and T256 among the prescaler output. This prescaler can be run or stopped by the timer control register TRUN. Counting starts when is set to "1", while the prescaler is cleared to zero and stops operation when is set to "0". When the IDLE1 mode (Operates only oscillator) is used, set TRUN to "0" to stop this prescaler before "HALT" instruction is executed. 2. Up counter This is an 8-bit binary counter which counts up by the input clock pulse specified by T10MOD and T32MOD. The input clock of timer 0, 2 are selected from the external clock from TI0 (Only timer 0) pin and the three internal clocks T1, T4, and T16, according to the set value of T10MOD/T32MOD registers. The input clock of timer 1 and 3 differs depending on the operation mode. When set to 16-bit timer mode, the overflow outputs of timer 0 and 2 are used as the input clock. When set to any other mode than 16-bit timer mode, the input clock is selected from the internal clocks T1, T16, and T256 as well as the comparator output (Match detection signal) of timer 0, 2 according to the set value of T10MOD and T32MOD registers. Example: When T10MOD = 01, the overflow output of timer 0 becomes the input clock of timer 1 (16-bit timer mode). When T10MOD = 00 and T10MOD = 01, T1 becomes the input of timer 1 (8-bit timer mode). Operation mode is also set by T10MOD and T32MOD registers. When reset, it is initialized to T10MOD = 00 and T32MOD = 00 whereby the up counter is placed in the 8-bit timer mode. The counting and stop and clear of up counter can be controlled for each interval timer by the timer operation control register TRUN. When reset, all up counters will be cleared to stop the timers.
93CS44-84
2004-02-10
TMP93CS44/S45
3. Timer register This is an 8-bit register for setting an interval time. When the set value of timer registers TREG0, TREG1, TREG2, TREG3, matches the value of up counter, the comparator match detect signal becomes active. If the set value is 00H, this signal becomes active when the up counter overflows. Timer registers TREG2 are double buffer structure, each of which makes a pair with register buffer. The timer flip-flop controll register TRDC bits control whether the double buffer structure in the TREG2 should be enabled or disabled. They are disabled when = 0 and enabled when they are set to 1. In the condition of double buffer enable state, the data is transfered from the register buffer to the timer register when the 2n - 1 overflow occurs in PWM mode, or at the PPG cycle in PPG mode. Therefore, during timer mode, the double buffer can not be used. When reset, it will be initialized to = 0 to disable the double buffer. To use the double buffer, write data in the timer register, set to 1, and write the following data in the register buffer.
Up counter
Comparator (CP2)
Timer register 2 (TREG2) Matching detection of PPG cycle 2n - 1 overflow of PWM Selector TREG2WR
Shift trigger Register buffer 2
Write Internal data bus
TRDC
Figure 3.7.4 Configuration of Timer Register 2 Note: Timer register and the register buffer are allocated to the same memory address. When = 0, the same value is written in the register buffer as well as the timer register, while when = 1 only the register buffer is written.
The memory address of each timer register is as follows. TREG0: 000022H TREG1: 000023H TREG2: 000026H TREG3: 000027H
All the registers are write only and cannot be read.
93CS44-85
2004-02-10
TMP93CS44/S45
4. Comparator A comparator compares the value in the up counter with the values to which the timer register is set. When they match, the up counter is cleared to zero and an interrupt signal (INTT0, INTT1, INTT2, INTT3) is generated. If the timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time. 5. Timer flip-flop (Timer F/F: TFF1, TFF3) The timer flip-flop is a flip-flop inverted by the match detect signal (8-bit comparator output) of each interval timer. Inverting is disabled or enabled by the timer flip-flop control register TFFCR. After reset operation, the value of TFF1, TFF3 is undefined. Writing 01 or 10 to TFFCR sets 0 or 1 to TFF1, TFF3. Additionally, writing 00 to this bit inverts the value of TFF1, TFF3. (Software inversion.) The signal of TFF3 is output through the TO3 pin (Also used as P41). When using as the timer output, the timer flip-flop should be set by port 4 function register P4FC beforehand. The output pin of TFF1 does not exist.
93CS44-86
2004-02-10
TMP93CS44/S45
Timer Operation Control Register 7
TRUN (0020H) Bit symbol Read/Write After reset Function PRRUN R/W 0 0
6
5
T5RUN
4
T4RUN
3
T3RUN R/W
2
T2RUN
1
T1RUN 0
0
T0RUN 0
0 0 0 Prescaler and timer run/stop control 0: Stop and clear 1: Run (Count up)
Count operation 0 Stop and clear 1 Count
PRRUN: Operation of prescaler T5RUN : Operation of 16-bit timer (Timer 5) T4RUN : Operation of 16-bit timer (Timer 4) T3RUN : Operation of 8-bit timer (Timer 3) T2RUN : Operation of 8-bit timer (Timer 2) T1RUN : Operation of 8-bit timer (Timer 1) T0RUN : Operation of 8-bit timer (Timer 0) Note: TRUN is always read as "1".
System Clock Control Register 7
SYSCR0 (006EH) Bit symbol Read/Write After reset Function 1 0 1 0
Low-frequency oscillator (fs) after released STOP mode 0: Stop 1: Oscillation High-frequency Low-frequency High-frequency oscillator (fc) oscillator (fs) oscillator (fc) after released 0: Stop 0: Stop STOP mode 1: Oscillation 1: Oscillation 0: Stop 1: Oscillation
6
XTEN
5
RXEN
4
RXTEN R/W
3
RSYSCK 0
2
WUEF 0
1
PRCK1 0
0
PRCK0 0
XEN
Select clock Warm-up after released timer (Write) STOP mode 0: Don't care 0: fc 1: Start timer 1: fs (Read) 0: End warm up 1: Not end warm up
Select prescaler clock 00: fFPH 01: fs 10: fc/16 11: (Reserved)
Select prescaler input clock 00 fFPH 01 10 11 fs fc/16 (Reserved)
Figure 3.7.5 8-Bit Timer Related Registers (1/5)
93CS44-87
2004-02-10
TMP93CS44/S45
Timer 0, 1 Mode Control Register 7
T10MOD (0024H) Bit symbol Read/Write After reset Function 0
Operation mode 00: 8-bit timer 01: 16-bit timer 10: - 11: -
6
T10M0 R/W 0
5
4
3
T1CLK1 0
2
T1CLK0 R/W 0
1
T0CLK1 0
0
T0CLK0 0
T10M1
Source clock of timer 1 00: TO0TRG 01: T1 10: T16 11: T256
Source clock of timer 0 00: TI0 01: T1 10: T4 11: T16
Input clock of timer 0 00 External Input (TI0) 01 10 11 T1 (Prescaler) T4 (Prescaler) T16 (Prescaler)
Input clock of timer 1
T10MOD 01 T10MOD = 01
00 01 10 11
Comparator output Overflow output of timer 0 of timer 0 Internal clock T1
Internal clock T16 Internal clock T256 (16-bit timer mode)
Set the operation mode of timer 0 and 1. 00 Two 8-bit timers (Timer 0 and timer 1) 01 16-bit timer 10 - 11 -
Figure 3.7.6 8-Bit Timer Related Register (2/5)
93CS44-88
2004-02-10
TMP93CS44/S45
Timer 2 and Timer 3 Mode Control Register 7
T32MOD (0028H) Bit symbol Read/Write After reset Function 0
Operation mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM
6
T32M0 0
5
PWM21 0
PWM cycle 00: Don't care 01: 26 - 1 10: 27 - 1 11: 28 - 1
4
PWM20 R/W 0
3
T3CLK1 0
2
T3CLK0 0
1
T2CLK1 0
0
T2CLK0 0
T32M1
Source clock of timer 3 00: TO2TRG 01: T1 10: T16 11: T256
Source clock of timer 2 00: - 01: T1 10: T4 11: T16
Input clock of timer 2 00 Don't set 01 T1 (Prescaler) 10 T4 (Prescaler) 11 T16 (Prescaler) Input clock of timer 3
T32MOD 01 T32MOD = 01
00 01 10 11
Comparator output Overflow output of timer 2 of timer 2 Internal clock T1
Internal clock T16 Internal clock T256 (16-bit timer mode)
Select PWM cycle 00 Don't care 01 (26 - 1) x Input clock frequency of timer 2 10 (27 - 1) x Input clock frequency of timer 2 11 (28 - 1) x Input clock frequency of timer 2 Set the operation mode of timer 2 and 3. 00 Two 8-bit timers (Timer 0 and timer 1) 01 16-bit timer 10 8-bit PPG output 11 8-bit PWM output (Timer 2) 8-bit timer (Timer 3)
Figure 3.7.7 8-Bit Timer Related Register (3/5)
93CS44-89
2004-02-10
TMP93CS44/S45
Timer Flip-Flop Control Register 7
TFFCR (0025H) Bit symbol Read/Write After reset Function 1
00: Invert TFF3 01: Set TFF3 10: Clear TFF3 11: Don't care
6
TFF3C0 W 1
5
TFF3IE R/W 0
TFF3 inversion trigger 0: Disable 1: Enable
4
TFF3IS 0
TFF3 inversion source 0: Timer 2 1: Timer 3 00: 01: 10: 11:
3
TFF1C1 W 1
Invert TFF1 Set TFF1 Clear TFF1 Don't care
2
TFF1C0 1
1
TFF1IE R/W 0
TFF1 inversion trigger 0: Disable 1: Enable
0
TFF1IS 0
TFF1 inversion source 0: Timer 0 1: Timer 1
TFF3C1
Select inverse signal of timer F/F3 ("Don't care" except in 8-bit timer mode) 0 Inversion by timer 2 1 Inversion by timer 3
Select inverse signal of timer F/F1 ("Don't care" except in 8-bit timer mode) 0 Inversion by timer 0 1 Inversion by timer 1
Inversion of timer F/F3 (TFF3) 0 Disable invert 1 Enable invert
Inversion of timer F/F1 (TFF1) 0 Disable invert 1 Enable invert
Control of timer F/F3 (TFF3) Invert the value of TFF3 00 (Software inversion) 01 Set TFF3 to "1" 10 Clear TFF3 to "0" 11 Don't care (Note)
Control of timer F/F1 (TFF1) Invert the value of TFF1 00 (Software inversion) 01 Set TFF1 to "1". 10 Clear TFF1 to "0". 11 Don't care (Note)
Note: TFFCR is always read as "1".
Figure 3.7.8 8-Bit Timer Related Register (4/5)
93CS44-90
2004-02-10
TMP93CS44/S45
Timer Register Double Buffer Control Register 7
TRDC (0029H) Bit symbol Read/Write After reset Function 0
0: Double buffer disable 1: Double buffer enable
6
5
4
3
2
1
TR2DE R/W
0
- 0
Always write "0".
Operation of timer register 2 double butter 0 Disable 1 Enable
Figure 3.7.9 8-Bit Timer Related Register (5/5) (1) 8-bit timer mode Four interval timers 0, 1, 2, 3 can be used independently as 8-bit interval timer. 1. Generating interrupts in a fixed cycle (in case of timer 1) To generate timer 1 interrupt at constant intervals using timer 1 (INTT1), first stop timer 1 then set the operation mode, input clock, and a cycle to T10MOD and TREG1 register, respectively. Then, enable interrupt INTT1 and start the counting of timer 1.
Example: To generate timer 1 interrupt every 1 second at fs = 32 kHz, set each register in the following manner. * Clock condition System clock: Low frequency (fs) Prescaler clock: Low frequency (fs)
TRUN T10MOD TREG1 INTET10 TRUN
MSB 76543210 - X - - - - 0 - 0 0 X X 1 0 - - 1 1 1 1 1 0 1 X - 1 1 - 1 - - 0 - - 1 - 1 0 - (
LSB Stop timer 1, and clear it to "0". Set the 8-bit timer mode, and select T16 (4 ms at fs = 32 kHz) as the input clock. Set the timer register 1 s / T16 = 250 = FAH Enable INTT1, and set it to Level 5. Start timer 1 counting.
X: Don't care, (: No change
Use the Table 3.7.1 for selecting the input clock. Note: The input clock of timer 0 and timer 1 are different from as follows. Timer 0: TI0 input, (T1, (T4, (T16. Timer 1: Match output of timer 0, (T1, (T16, (T256.
93CS44-91
2004-02-10
TMP93CS44/S45
2. Generating a 50% duty square wave pulse The timer flip-flop is included in timer 1 and 3. The timer flip-flop (TFF3) is inverted at constant intervals, and its status is output to timer output pin (TO3). The output pin of TFF1 does not exist.
Example: To output a 2.4 (s square wave pulse from TO3 pin at fc ( 20 MHz, set each register in the following procedures. Either timer 2 or timer 3 may be used, but this example uses timer 3. System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
TRUN T32MOD TREG3 TFFCR P4CR P4FC TRUN
76543210 - X - - 0 - - - 0 0 X X 0 1 - - 0 1 0 0 0 1 0 1 0 - 0 - 1 - 1 -
Stop timer 3, and clear it to "0". Set the 8-bit timer mode, and select T1 (0.4 s at fc = 20 MHz) as the input clock. Set the timer register at 2.4 s / T1 / 2 = 3. Set TFF3 to "0", and set to invert by the match detect signal from timer 3. Select P41 as TO3 pin. Start timer 3 counting.
- - - - - - 1 - - X X - X X 1 X - X - - 1 - - -
X: Don't care, -: No change
T1 TRUN Bit7 to 2 Up counter Bit1 Bit0 Comparator timing Comparator output (Matching detect) INTT3 UC3 clear 0 1 2 3 0 1 2 3 0 1 2 3 0
TFF3 TO3 1.2 s at fc = 20 MHz
Figure 3.7.10 Square Wave (50% duty) Output Timing Chart
93CS44-92
2004-02-10
TMP93CS44/S45
3. Making timer 1 count up by match signal from timer 0 comparator (Same function is achieved by using timer 3 and timer 2) Set the 8-bit timer mode, and set the comparator output of timer 0 as the input clock to timer 1.
Comparator output (Timer 0 match) Timer 0 up counter (when TREG0 = 5) Timer 1 up counter (when TREG1 = 2) Timer 1 match output 1 2 3 1 4 5 1 2 3 2 4 5 1 2 1 3
Figure 3.7.11 Timer 1 Count up by Timer 0 (2) 16-bit timer mode A 16-bit interval timer is configured by using the pair of timer 0 and timer 1 or timer 2 and timer 3. To make a 16-bit interval timer by cascade connecting timer 0 and timer 1, set timer 0/1 mode register T10MOD to 01. When set in 16-bit timer mode, the overflow output of timer 0 will become the input clock of timer 1 and 3, regardless of the set value of T10MOD and T32MOD. Table 3.7.1 shows the relation between the cycle of timer (Interrupt) and the selection of input clock. The lower 8 bits of the timer (Interrupt) cycle are set by the timer register TREG0 or TREG2, and the upper 8 bits are set by TREG1 or TREG3. Note that TREG0 and TREG2 always must be set first. (Writing data into TREG0 and TREG2 disables the comparator temporarily, and the comparator is restarted by writing data into TREG1 and TREG3.)
Setting example: To generate an interrupt INTT3 every 0.4 seconds at fc = 20 MHz, set the following values for timer registers TREG2 and TREG3. System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
When counting with input clock of T16 (6.4 s at 20 MHz) 0.4 s / 6.4 s = 62500 = F424H Therefore, set TREG3 = F4H and TREG2 = 24H, respectively.
93CS44-93
2004-02-10
TMP93CS44/S45
The comparator match signal is output from timer 2 each time the up counter UC2 matches TREG2, where the up counter UC2 is not be cleared. With the timer 3 comparator, the match detect signal is output at each comparator timing when up counter UC3 and TREG3 values match. When the match detect signal is output simultaneously from both comparators of timer 2 and timer 3, the up counters UC2 and UC3 are cleared to 0, and the interrupt INTT3 is generated. If inversion is enabled, the value of the timer flip-flop TFF3 is inverted. Example: When TREG3 = 04H and TREG2 = 80H
Value of up counter 0000H (UC3, UC2) Timer 2 comparator match detect signal Interrupt INTT3 Timer output TO3 Inversion 0080H 0180H 0280H 0380H 0480H
Figure 3.7.12 Timer Output by 16-Bit Timer Mode (3) 8-bit PPG (Programmable pulse generation) output mode Square wave pulse can be generated at any frequency and duty by timer 2. The output pulse may be either low active or high active. In this mode, timer 3 cannot be used. Timer 2 outputs pulse to TO3 pin (Also used as P41).
tH t tL
TREG2 and UC2 match (Interrupt INTT2) TREG3 and UC2 match (Interrupt INTT3) TO3 TREG2 TREG3
Figure 3.7.13 8-Bit PPG Output Waveforms
93CS44-94
2004-02-10
TMP93CS44/S45
In this mode, a programmable square wave is generated by inverting timer output each time the 8-bit up counter (UC2) matches the timer registers TREG2 and TREG3. However, it is required that the set value of TREG2 is smaller than that of TREG3. Though the up counter (UC3) of timer 3 is not used in this mode, UC3 should be set for counting by setting TRUN to 1. Figure 3.7.14 shows the block diagram for this mode.
TRUN T1 T4 T16 8-bit up counter (UC2) TO3 TFFCR Inversion T32MOD INTT2 Comparator Comparator INTT3
Selector
TFF3
TREG2 Selector TREG2-WR TRDC Register buffer TREG3 Shift trigger
Internal data bus
Figure 3.7.14 Block Diagram of 8-Bit PPG Output Mode When the double buffer of TREG2 is enabled in this mode, the value of register buffer will be shifted in TREG2 each time TREG3 matches UC2. Use of the double buffer makes easy the handling of low duty waves (when duty is varied).
Match with TREG2 and up counter (Up counter = Q1) Match with TREG 3 Shift from register buffer TREG2 (Value to be compared) Register buffer Q1 Q2 Q2 Q3 TREG 2 (Register buffer) write (Up counter = Q2)
Figure 3.7.15 Operation of Register Buffer
93CS44-95
2004-02-10
TMP93CS44/S45
Example: Generating 1/4 duty 62.5 kHz pulse (at fc = 20 MHz)
16 s
* Clock condition
System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
Calculate the value to be set for timer register. To obtain the frequency 62.5 kHz, the pulse cycle t should be: t = 1/62.5 kHz = 16 s. Given T1 = 0.4 s (at 20 MHz), 16 s / 0.4 s = 40 Consequently, to set the timer register 3 (TREG3) to TREG3 = 40 = 28H and then duty to 1/4, t x 1/4 = 16 s x 1/4 = 4 s 4 s / 0.4 s = 10 Therefore, set timer register 2 (TREG2) to TREG2 = 10 = 0AH. 76 -X 10 00 00 01 5 - X 0 1 1 4 - X 0 0 X 3 0 X 1 1 - 2 0 X 0 0 - 1 - 0 1 0 - 0 - 1 0 0 -
TRUN T32MOD TREG2 TREG3 TFFCR

Stop timer 2, 3 and clear it to "0". Set the 8-bit PPG mode, and select T1 as input clock. Write "0AH". Write "28H". Sets TFF3 and enable the inversion and double buffer enable. Writing "10" provides negative logic pulse. Set P41 as the TO3 pin. Start timer 2 and timer 3 counting.
P4CR P4FC TRUN
- - - - - - 1 - - X X - X X 1 X 1 X - - 1 1 - -
X: Don't care, -: No change
93CS44-96
2004-02-10
TMP93CS44/S45
(4) 8-bit PWM Output mode This mode is valid only for timer 2. In this mode, maximum 8-bit resolution of PWM pulse can be output. PWM pulse is output to TO3 pin (also used as P41) when using timer 2. Timer 3 can also be used as 8-bit timer. Timer output is inverted when up counter (UC2) matches the set value of timer register TREG2 or when 2n - 1 (n = 6, 7 or 8; specified by T32MOD) counter overflow occurs. Up counter UC0 is cleared when 2n - 1 counter overflow occurs. To use this PWM mode, the following conditions must be satisfied. (Set value of timer register) < (Set value of 2n - 1 counter overflow) (Set value of timer register) 0
TREG2 and UC2 match 2n - 1 Overflow (Interrupt INTT2)
TO3
tPWM (PWM cycle)
Figure 3.7.16 8-Bit PWM Waveforms Figure 3.7.17 shows the block diagram of this mode.
TRUN T1 T4 T16 8-bit up counter (UC2) TO3
Selector
Clear
TFF3 Invert
TFFCR
T32MOD
2n - 1 overflow control Overflow
T32MOD = 11 T32MOD
Comparator
INTT2 TREG2 Selector TREG2-WR TRDC Register buffer Shift trigger
Internal data bus
Figure 3.7.17 Block Diagram of 8-Bit PWM Mode
93CS44-97
2004-02-10
TMP93CS44/S45
In this mode, the value of register buffer will be shifted in TREG2 if 2n - 1 overflow is detected when the double buffer of TREG2 is enabled. Use of the double buffer makes easy the handling of small duty waves.
Match with TREG2 Up counter = Q1 2n - 1 overflow Shift into TREG2 TREG2 (Value to be compared) Register buffer Q1 Q2 Q2 Q3 TREG2 (Register buffer) write Up counter = Q2
Figure 3.7.18 Operation of Register Buffer
Example: To output the following PWM waves to TO3 pin at fc = 20 MHz.
28.8 s 50.8 s System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
To realize 50.8 s of PWM cycle by T1 = 0.4 s (at fc = 20 MHz), 50.8 s / 0.4 s = 127 = 2n - 1 Consequently, n should be set to 7. As the period of low level is 28.8 s, for T1 = 0.4 s, set the following value for TREG2. 28.8 s / 0.4 s = 72 = 48H MSB 76543210 - X - - - 0 - - 1 1 1 0 - - 0 1 0 1 0 1 0 1 - - - - X X 1 X - 01 X- -- -X - 0 0 - 1 - 0 LSB Stop timer 2, and clear it to "0". Set 8-bit PWM mode (cycle: 27 - 1) and select T1 as the input clock. Writes "48H". Clears TFF3, enable the inversion and double buffer. Set P41 as the TO3 pin. Start timer 2 counting.
TRUN T32MOD TREG2 TFFCR P4CR P4FC TRUN
- - X -1
- - 1X -
X: Don't care, -: No change
93CS44-98
2004-02-10
TMP93CS44/S45
Table 3.7.2 PWM Cycle
at fc = 20 MHz, fs = 32.768 kHz
Select Select Prescaler System Clock Clock
1 (fs) 00 (fFPH)
PWM Cycle
Gear Value
XXX 000 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16)
26 - 1 T1
15.4 ms 25.2 s 50.4 s 100.8 s 201.6 s 403.2 s
27 - 1 T16
246 ms 403.2 s 806.4 s 1.61 ms 3.23 ms 6.45 ms
28 - 1 T16
496 ms 812.8 s 1.63 ms 3.26 ms 6.52 ms 13.04 ms
T4
61.5 ms 100.8 s 201.6 s 403.2 s 806.4 s 1.61 ms
T1
31.0 ms 50.8 s 101.6 s 203.2 s 406.4 s 812.8 s
T4
124 ms 203.2 s 406.4 s 812.8 s 1.63 ms 3.25 ms
T1
62.3 ms 102.0 s 204.0 s 408.0 s 816.0 s 1.63 ms
T4
249 ms 408.0 s 816.0 s 1.63 ms 3.26 ms 6.53 ms
T16
996 ms 1.63 ms 3.26 ms 6.53 ms 13.06 ms 26.11 ms
0 (fc)
XXX
01 (Low-frequency clock) 10 (fc/16 clock)
XXX
15.4 ms
61.5 ms
246 ms
31.0 ms
124 ms
496 ms
62.3 ms
249 ms
996 ms
XXX
XXX
403.2 s
1.61 ms
6.45 ms
812.8 s
3.25 ms
13.04 ms
1.63 ms
6.53 ms
26.11 ms
XXX: Don't care (5) Timer mode setting registers Table 3.7.3 shows the list of 8-bit timer modes. Table 3.7.3 Timer Mode Setting Register
Register Name Name of Function in Register Function T10M/T32M Timer Mode * 16-bit timer mode 01 - - T10MOD/T32MOD PWM2 PWM Cycle T1CLK/T3CLK Upper Timer Input Clock T0CLK/T2CLK Lower Timer Input Clock External clock (Only timer 0), T1, T4, T16 (00, 01, 10, 11) External clock (Only timer 0), T1, T4, T16 (00, 01, 10, 11) * External clock (Only timer 0), T1, T4, T16 (00, 01, 10, 11) * External clock (Only timer 0), T1, T4, T16 (00, 01, 10, 11) - TFFCR TFF1IS/TFF3IS Timer F/F Invert Signal Select
- 0: Lower timer output 1: Upper timer output * -
* 8-bit timer x 2 channels 00 -
Lower timer match, T1, 16, 256 (00, 01, 10, 11) * -
* 8-bit PPG x 1 channel 10
* -
* 8-bit PWM x 1 channel 11
* * 26 - 1, 27 - 1, 28 - 1 (01, 10, 11)
* -
-
8-bit timer x 1 channel
* 11
-
T1, T16, T256 (01, 10, 11)
Output disabled
-: Don't care, *: Don't set in T10MOD
93CS44-99
2004-02-10
TMP93CS44/S45
3.8
16-Bit Timers/Event Counters
The TMP93CS44/TMP93CS45 contains two (Timer 4 and timer 5) multifunctional 16-bit timer/event counter with the following operation modes. * * * 16-bit interval timer mode 16-bit event counter mode 16-bit programmable pulse generation (PPG) mode Can be used following operation modes by capture function. * * * Frequency measurement mode Pulse width measurement mode Time differential measurement mode
Timer/event counter consists of 16-bit up counter, two 16-bit timer registers, two 16-bit capture registers (One of them applies double buffer), two comparators, capture input controller, and timer flip-flop and the control circuit. Timer/event counter is controlled by 4 control registers: T4MOD/T5MOD, T4FFCR/T5FFCR, TRUN and T45CR. Figure 3.8.1, 2 shows the block diagram of 16-bit timer/event counter (Timer 4 and timer 5). Timer 4 and 5 can be used independently. All timers operate in the same manner, and thus only the operation of timer 4 will be explained below.
93CS44-100
2004-02-10
Internal data bus Upper byte Upper byte Lower byte Capture register 2 CAP2 Trigger T4FFCR TO4 Timer F/F control TRUN Clear Selector Count clock 16-bit up counter UC4 TRUN T4MOD INTTO4 T4MOD INTTR4 INTTR5 TFF4 Capture register 1 CAP1 T4MOD Software capture Trigger Lower byte
TFF1
TI4
Capture control
TI5
T4MOD T1 T4 T16
TI4 external input
INT4 INT5
Figure 3.8.1 Block Diagram of 16-Bit Timer (Timer 4)
93CS44-101
Comparator CP4 Match detection TREG4 Selector Register buffer4 Upper byte T45CR Lower byte Internal data bus TREG4-WR
Comparator CP5
Match detection
TREG5
TMP93CS44/S45
2004-02-10
Upper byte
Lower byte
Internal data bus Upper byte Capture register 3 CAP3 T5MOD Software capture Trigger Trigger Capture register 4 CAP4 T5FFCR TO6 Timer F/F control TRUN Clear Selector Count clock 16-bit up counter UC5 TRUN T5MOD INTTO5 T5MOD INTTR7 INTTR6 TFF6 Lower byte Upper byte Lower byte
TFF1
TI6
Capture control
TI7
T5MOD T1 T4 T16
TI6 external input
INT6 INT7
Figure 3.8.2 Block Diagram of 16-Bit Timer (Timer 5)
Comparator CP6 Match detection Comparator CP7 TREG6 Selector Register buffer 6 Upper byte T45CR Lower byte Internal data bus TREG6-WR TREG7 Upper byte
93CS44-102
Match detection
TMP93CS44/S45
2004-02-10
Lower byte
TMP93CS44/S45
Timer 4 Mode Control Register 7
T4MOD (0038H) Bit symbol Read/Write After reset Function
6
5
CAP1IN W 1
4
3
2
CLE R/W 0
0: UC4 clear disable 1: UC4 clear enable
1
T4CLK1 0
0
T4CLK0 0
CAP12M1 CAP12M0 0 0
0: Software Capture timing capture 00: Disable 1: Don't care INT4 occurs at rising edge. 01: TI4 TI5 INT4 occurs at rising edge. 10: TI4 TI4 INT4 occurs at rising edge. 11: TFF1 TFF1 INT4 occurs at rising edge.
Timer 4 source clock 00: TI4 pin 01: T1 10: T4 11: T16
Timer 4 input clock 00 External clock (TI4) 01 10 11 T1 T4 T16
Clearing the up counter UC4 0 Clear disable 1 Clear by match with TREG5.
Capture timing of timer4 Capture control 00 Capture disable 01 CAP1 at TI4 rise CAP2 at TI5 rise CAP1 at TI4 rise CAP2 at TI4 fall CAP1 at TFF1 rise CAP2 at TFF1 fall
INT4 control Interrupt occurs at the rising edge of TI4 (INT4) input. Interrupt occurs at the falling edge of TI4 (INT4) input. Interrupt occurs at the rising edge of TI4 (INT4) input.
10
11
Software capture control 0 The up counter 4 value is loaded to CAP1. 1 Don't care
Figure 3.8.3 16-Bit Timer/Event Counter Related Register (1/6)
93CS44-103
2004-02-10
TMP93CS44/S45
Timer 4 Flip-Flop Control Register 7
T4FFCR (0039H) Bit symbol Read/Write After reset Function
6
5
CAP2T4
4
CAP1T4 R/W
3
EQ5T4 0
2
EQ4T4 0
1
TFF4C1 W
0
TFF4C0
0 0 TTF4 invert trigger 0: Disable trigger 1: Enable trigger Invert when Invert when the UC the UC value is value is loaded to loaded to CAP2 CAP1
1 1 00: Invert TFF4 01: Set TFF4 10: Clear TFF4 Invert when Invert when 11: Don't care the UC the UC Always read as "11". matches matches TREG5 TREG4
Timer flip-flop 4 (TFF4) control 00 Inverts the TFF4 value (Software inversion). 01 Sets TFF4 to "1". 10 Clear TFF4 to "0". 11 Don't care (Always read as "11".)
Invert when the UC matches TREG4 Timer flip-flop 4 (TFF4) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC matches TREG5 Timer flip-flop 4 (TFF4) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC value is loaded to CAP1 Timer flip-flop 4 (TFF4) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC value is loaded to CAP2 Timer flip-flop 4 (TFF4) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Figure 3.8.4 16-Bit Timer/Event Counter Related Register (2/6)
93CS44-104
2004-02-10
TMP93CS44/S45
Timer 5 Mode Control Register 7
T5MOD (0048H) Bit symbol Read/Write After reset Function
6
5
CAP3IN W 1
0: Software capture 1: Don't care
4
3
2
CLE R/W 0
0: UC5 clear disable 1: UC5 clear enable
1
T5CLK1 0
0
T5CLK0 0
CAP34M1 CAP34M0 0 0
Capture timing 00: Disable INT6 occurs at rising edge. 01: TI6 TI7 INT6 occurs at rising edge. 10: TI6 TI6 INT6 occurs at fall edge. 11: TFF1 TFF1 INT6 occurs at rising edge.
Timer 5 source clock 00: TI6 pin 01: T1 10: T4 11: T16
Timer 5 input clock 00 External clock (TI6) 01 10 11 T1 T4 T16
Clearing the up counter UC5 0 Clear disable 1 Clear by match with TREG7
Timer 5 capture timing Capture control 00 Capture disable 01 CAP3 at TI6 rise CAP4 at TI7 rise
INT6 Control Interrupt occurs at the rising edge of TI6 (INT6) input. Interrupt occurs at the falling edge of TI6 (INT6) input. Interrupt occurs at the rising edge of TI6 (INT6) input.
CAP3 at TI6 rise 10 CAP4 at TI6 fall CAP3 at TFF1 rise 11 CAP4 at TFF1 fall
Software capture control 0 The up counter 5 value is loaded to CAP3. 1 Don't care
Figure 3.8.5 16-Bit Timer/Event Counter Related Register (3/6)
93CS44-105
2004-02-10
TMP93CS44/S45
Timer 5 Flip-Flop Control Register 7
T5FFCR (0049H) Bit symbol Read/Write After reset Function
6
5
CAP4T6
4
CAP3T6 R/W
3
EQ7T6 0
2
EQ6T6 0
1
TFF6C1 W
0
TFF6C0
0 0 TTF6 invert trigger 0: Disable trigger 1: Enable trigger Invert when Invert when the UC the UC value is value is loaded to loaded to CAP4 CAP3
1 1 00: Invert TFF6 01: Set TFF6 10: Clear TFF6 Invert when Invert when 11: Don't care the UC the UC Always read as "11". matches matches TREG7 TREG6
Timer flip-flop 6 (TFF6) control 00 Inverts the TFF6 value (Software inversion). 01 Sets TFF6 to "1". 10 Clear TFF6 to "0". 11 Don't care (Always read as "11".)
Invert when the UC matches TREG6 Timer flip-flop 6 (TFF6) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC matches TREG7 Timer flip-flop 6 (TFF6) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC value is loaded to CAP3 Timer flip-flop 6 (TFF6) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Invert when the UC value is loaded to CAP4 Timer flip-flop 6 (TFF6) invert trigger 0 Trigger disable (Invert prohibition) 1 Trigger enable (Invert permission)
Figure 3.8.6 16-Bit Timer/Event Counter Related Register (4/6)
93CS44-106
2004-02-10
TMP93CS44/S45
Timer 4 and Timer 5 Control Register 7
T45CR (003AH) Bit symbol Read/Write After reset Function QCU R/W 0 Watchdog timer/ warm-up timer control
6
5
4
3
2
1
DB6EN R/W
0
DB4EN
0 0 Double buffer 0: Disable 1: Enable Double Double buffer of buffer of TREG6 TREG4
Double buffer control 0 Disable 1 Enable
DB6EN: Double buffer of TREG6 DB4EN: Double buffer of TREG4
Watchdog timer/warm-up timer input control 0 Use 7 stage binary counter 1 Note 1: Not use 7 stage binary counter (Note 1)
In case of unused 7 state binary counter as a warm-up timer, the stable clock must be input from external circuit.
Note 2:
Bit6 to 2 of T45CR is read as 1.
Figure 3.8.7 16-Bit Timer/Event Counter Related Register (5/6)
93CS44-107
2004-02-10
TMP93CS44/S45
Timer Operation Control Register 7
TRUN (0020H) Bit symbol Read/Write After reset Function PRRUN R/W 0 0
6
5
T5RUN
4
T4RUN
3
T3RUN R/W
2
T2RUN
1
T1RUN 0
0
T0RUN 0
0 0 0 Prescaler and timer run/stop control 0: Stop and clear 1: Run (Count up)
Count operation 0 Stop and clear 1 PRRUN: Operation of prescaler T5RUN: Operation of 16-bit timer (Timer 5) T4RUN: Operation of 16-bit timer (Timer 4) T3RUN: Operation of 8-bit timer (Timer 3) T2RUN: Operation of 8-bit timer (Timer 2) T1RUN: Operation of 8-bit timer (Timer 1) T0RUN: Operation of 8-bit timer (Timer 0) Note: Bit6 of TRUN is read as "1". Count
System Clock Control Register 7
SYSCR0 (006EH) Bit symbol Read/Write After reset Function 1 0 1 0 XEN
6
XTEN
5
RXEN
4
RXTEN R/W
3
RSYSCK 0
2
WUEF 0
1
PRCK1 0
Select gear value of high frequency (fs) 00: fFPH 01: fs 10: fc/16 11: (Reserved)
0
PRCK0 0
High-frequency Low-frequency High-frequency Low-frequency Select clock Warm-up oscillator (fc) oscillator (fs) oscillator (fc) oscillator (fc) after released timer after released after released STOP mode (Write) STOP mode STOP mode 0: Stop 0: Stop 0: Don't care 0: Stop 0: fc 1: Oscillaton 1: Oscillaton 0: Stop 1: Start timer 1: Oscillaton 1: Oscillaton 1: fs (Read) 0: End warm up 1: Not end warm up
Select gear value of high frequency 00 fFPH 01 10 11 fs fc/16 (Reserved) 1/4 times clock
Figure 3.8.8 16-Bit Timer/Event Counter Related Registers (6/6)
93CS44-108
2004-02-10
TMP93CS44/S45
1. Prescaler There are 9-bit prescaler and prescaler clock selection registers to generate input clock for 8-bit timer 0, 1, 2, 3, 16-bit timer 4, 5 and serial interface 0, 1. Figure 3.8.9 shows the block diagram. Table 3.8.1 shows prescaler clock resolution into 8, 16-bit Timer.
to CPU System clock fSYS 9-bit prescaler 2 4 8 16 32 64 128 256 512
/2 fFPH
Selector
/4
T1 T4 T16 T256 T1 T4 T16 1 T0 T2 T8 T32
To 8-bit timer 0, 1, 2, 3
XT1
fs
TRUN SYSCR1 Selector /2
Selector
SYSCR0 Run/stop and clear
To 16-bit timer 4, 5
To serial interface 0, 1
fc
fc/2
fc/4
fc/8 fc/16
X1
/2 /4 /8 /16
SYSCR1
Figure 3.8.9 The Block Diagram of Prescaler Table 3.8.1 Prescaler Clock Resolution to 8-Bit Timer and 16-Bit Timer
at fc = 20 MHz, fs = 32.768 kHz
Select System Select Prescaler Clock Clock
1 (fs)
Gear Value
XXX 000 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16)
3
Prescaler Clock Resolution
T1
5
T4
7
T16 fs/2 (3.9 ms) fc/27 (6.4 s) fc/2 (12.8 s)
8 9 11
T256 fs/2 (62.5 ms) fc/211 (102.4 s) fc/212 (204.8 s) fc/213 (409.6 s) fc/214(819.2 s)
fs/2 (244 s) fs/2 (977 s) fc/23 (0.4 s) fc/2 (0.8 s)
4 5 6 7
fc/25 (1.6 s) fc/2 (3.2 s)
6 7 8 9
0 (fc)
00 (fFPH)
fc/2 (1.6 s) fc/2 (3.2 s) fc/2 (6.4 s)
fc/2 (6.4 s)
fc/2 (25.6 s)
10 11
fc/2 (12.8 s) fc/2 (51.2 s)
fc/2 (25.6 s) fc/2 (102.4 s) fc/215 (1.6384 ms) fs/27 (3.9 ms) fs/211 (62.5 ms)
XXX
01 (Low-frequency clock) 10 (Note) (fc/16 clock) XXX: Don't care
XXX
fs/23 (244 s) fs/25 (977 s) fc/27 (6.4 s)
XXX
XXX
fc/29 (25.6 s) fc/211 (102.4 s) fc/215 (1.6384 ms) 16-bit timer 8-bit timer
Note: The fc/16 clock as a prescaler clock can not be used when the fs is used as a system clock.
93CS44-109
2004-02-10
TMP93CS44/S45
The clock selected among fFPH clock, fc/16 clock, and fs clock is divided by 4 and input to this prescaler. This is selected by prescaler clock selection register SYSCR0. Resetting sets to 00, therefore fFPH/4 clock is input. The 16-bit timer 4, 5 selects between 3 clock inputs: T1, T4, and T16 among the prescaler outputs. This prescaler can be run or stopped by the timer operation control register TRUN. Counting starts when is set to 1, while the prescaler is cleared to 0 and stops operation when is set to 0. When the IDLE1 mode (Operates only oscillator) is used, set TRUN to 0 to stop this prescaler before "HALT" instruction is executed. 2. Up counter UC4 is a 16-bit binary counter which counts up according to the input clock specified by T4MOD register. As the input clock, one of the internal clocks T1, T4, and T16 from 9-bit prescaler (also used for 8-bit timer), and external clock from TI4 pin (also used as P42/INT4 pin) can be selected. When reset, it will be initialized to = 00 to select TI4 input mode. Counting or stop and clear of the counter is controlled by timer operation control register TRUN. When clearing is enabled, up counter UC4 will be cleared to 0 each time it coincides matches the timer register TREG5. The "clear enable/disable" is set by T4MOD. If clearing is disabled, the counter operates as a free-running counter. A timer overflow interrupt (INTTO4) is generated when UC4 overflow occurs. 3. Timer registers These two 16-bit registers are used to set the interval time. When the value of up counter UC4 matches the set value of this timer register, the comparator match detect signal will be active. Setting data for both upper and lower timer registers (TREG4 and TREG5) is always needed. For example, either using 2-byte data transfer instruction or using 1-byte data transfer instruction twice for lower 8 bits and upper 8 bits in order.
Timer 4 TREG4 Upper 8 bits (TREG4H) 000031H Timer 5 TREG6 Upper 8 bits (TREG6H) 000041H Lower 8 bits (TREG6L) 000040H Upper 8 bits (TREG7H) 000043H TREG7 Lower 8 bits (TREG7L) 000042H Lower 8 bits (TREG4L) 000030H Upper 8 bits (TREG5H) 000033H TREG5 Lower 8 bits (TREG5L) 000032H
TREG4 to TREG7 are write-only registers, so they can not be read by software.
93CS44-110
2004-02-10
TMP93CS44/S45
TREG4 timer register is of double buffer structure, which is paired with register buffer. The timer control register T45CR controls whether the double buffer structure should be enabled or disabled. Disabled when = 0, while enabled when = 1. When the double buffer is enabled, the timing to transfer data from the register buffer to the timer register is at the match between the up counter (UC4) and timer register TREG5. After reset, TREG4 and TREG5 are undefined. To use the 16-bit timer after reset, data should be written beforehand. When reset, it will be initialized to = 0, whereby the double buffer is disabled. To use the double buffer, write data in the timer register, set = 1, and then write the following data in the register buffer. TREG4 and register buffer are allocated to the same memory addresses 000030H/000031H. When = 0, same value will be written in both the timer register and register buffer. When = 1, the value is written into only the register buffer. 4. Capture register These 16-bit registers are used to latch the values of the up counter. Data in the capture registers should be read all 16 bits. For example, using a 2-byte data load instruction or two 1-byte data load instruction, from the lower 8-bit followed by the upper 8 bits.
Timer 4 CAP1 Upper 8 bits (CAP1H) 000035H Timer 5 CAP3 Upper 8 bits (CAP3H) 000045H Lower 8 bits (CAP3L) 000044H Upper 8 bits (CAP4H) 000047H CAP4 Lower 8 bits (CAP4L) 000046H Lower 8 bits (CAP1L) 000034H Upper 8 bits (CAP2H) 000037H CAP2 Lower 8 bits (CAP2L) 000036H
CAP1 to CAP4 are read-only registers, so it cannot be written by software.
93CS44-111
2004-02-10
TMP93CS44/S45
5. Capture input control This circuit controls the timing to latch the value of up counter UC4 into CAP1, CAP2. The latch timing of capture register is controlled by register T4MOD. * * When T4MOD = 00 Capture function is disabled. Disable is the default on reset. When T4MOD = 01 Data is loaded to CAP1 at the rise edge of TI4 pin (also used as P42/INT4) input, while data is loaded to CAP2 at the rise edge of TI5 pin (also used as P43/INT5) input. * When T4MOD = 10 Data is loaded to CAP1 at the rise edge of TI4 pin input, while to CAP2 at the fall edge. Only in this setting, interrupt INT4 occurs at fall edge. * When T4MOD = 11 Data is loaded to CAP1 at the rise edge of timer flip-flop TFF1, while to CAP2 at the fall edge. Besides, the value of up counter can be loaded to capture registers by software. Whenever "0" is written in T4MOD the current value of up counter will be loaded to capture register CAP1. It is necessary to keep the prescaler in RUN mode (TRUN to be "1"). 6. Comparator These are 16-bit comparators which compare the up counter UC4 value with the set value of (TREG4, TREG5) to detect the match. When a match is detected, the comparators generate an interrupt (INTTR4, INTTR5) respectively. The up counter UC4 is cleared only when UC4 matches TREG5. (The clearing of up counter UC4 can be disabled by setting T4MOD = 0.) 7. Timer flip-flop (TFF4) This flip-flop is inverted by the match detect signal from the comparators and the latch signals to the capture registers. Disable/enable of inversion can be set for each element by T4FFCR. After reset, the value of TFF4 is undefined. TFF4 will be inverted when "00" is written in T4FFCR. Also it is set to "1" when "01" is written, and set to "0" when "10" is written. The value of TFF4 can be output to the timer output pin TO4 (also used as P44). Timer output should be specified by the function register of port 4. (See register for port 4 in Figure 3.5.11.)
93CS44-112
2004-02-10
TMP93CS44/S45
(1) 16-bit timer mode Generating interrupts at fixed intervals In this example, the interval time is set in the timer register TREG5 to generate the interrupt INTTR5.
7 TRUN INTET54 T4FFCR T4MOD TREG5 TRUN - 1 X 0 * * 1 6 5 4 3 - 1 0 0 2 1 0 - 0 1 * * * - Stop timer 4. Enable INTTR5 and sets interrupt level 4. Disable INTTR4. Disable trigger. Select internal clock for input and disable the capture function. Set the interval time (16 bits). Start timer 4.
X-0 100 X00 010
-- 00 01 1*
(** = 01, 10, 11) ****** ****** X-1---
X: Don't care, -: No change
(2) 16-bit event counter mode In 16-bit timer mode as described in above, the timer can be used as an event counter by selecting the external clock (TI4 pin input) as the input clock. To read the value of the counter, first perform "software capture" once and read the captured value. The counter counts at the rise edge of TI4 pin input. TI4 pin can also be used as P42/INT4. Since both timers operate in exactly the same way, timer 4 is used for the purposes of explanation.
7 TRUN P4CR INTET54 T4FFCR T4MOD TREG5 TRUN - - 1 X 0 * 1 6 5 4 0 - 0 3 - - 1 0 0 * - 2 1 0 - - 0 1 0 * - Stop timer 4. Set P42 to input mode. Enable INTTR5 and sets interrupt level 4, while disables INTTR4. Disable trigger. Select TI4 as the input clock. Set the number of counts (16 bits). Start timer 4.
X- -- 10 X 0 * X
-- 0- 00 01 10 ** --
00 10 ** -1
X: Don't care, -: No change When used as an event counter, set the prescaler in RUN mode. (TRUN = 1)
93CS44-113
2004-02-10
TMP93CS44/S45
(3) 16-bit programmable pulse generation (PPG) output mode Square wave pulse can be generated at any frequency and duty by timer 4. The output pulse may be either low active or high active. The PPG mode is obtained by inversion of the timer flip-flop TFF4 that is to be enabled by the match of the up counter UC4 with the timer register TREG4 or TREG5 and to be output to TO4 (also used as P44). In this mode, the following conditions must be satisfied. (Set value of TREG4) < (Set value of TREG5)
Match with TREG4 (Interrupt INTTR4) Match with TREG5 (Interrupt INTTR5) TO4 pin
Figure 3.8.10 Programmable Pulse Generation (PPG) Output Waveforms When the double buffer of TREG4 is enabled in this mode, the value of register buffer 4 will be shifted in TREG4 at match with TREG5. This feature makes easy the handling of low duty waves.
Match with TREG4 Match with TREG5 Shift into the TREG5 TREG4 (Value to be compared) Register buffer Q1 Q2 Q2 Q3 Write into the TREG4 Up counter = Q1 Up counter = Q2
Figure 3.8.11 Operation of Register Buffer
93CS44-114
2004-02-10
TMP93CS44/S45
Shows the block diagram of this mode.
TRUN TI4 pin T1 T4 T16 16-bit up counter UC4 TO4 (PPG output)
Selector
Clear
F/F (TFF4)
16-bit comparator
Match
16-bit comparator
TREG4 Selector TREG4-WR T45CR Register buffer 4 TREG5
Internal data bus
Figure 3.8.12 Block Diagram of 16-Bit PPG Mode
In 16-bit PPG mode, set the registers is the following order:
7 T45CR TRUN TREG4 TREG5 T45CR T4FFCR T4MOD P4CR P4FC TRUN 0 - * * 0 6 X X * * X 5 X - * * X 4 X 0 * * X 0 0 3 X - * * X 1 0 2 X - * * X 1 1 1 - - * * - 1 * 0 0 - * * 1 0 * - X - Double buffer of TRG4 disable. Stop timer 4. Set the duty (16 bits). Set the cycle (16 bits). Double buffer of TREG4 enable. (Change the duty and cycle at the interrupt INTTR5.) Set the mode to invert TFF4 at the match with TREG4/TREG5, and also set the TFF4 to "0". Select the internal clock for the input, and disable the capture function. Assign P44 as TO4. Start timer 4.
X X 0 0 - - 1 0 1
(** = 01, 10, 11) --1--- XX1 X-1 XX- ---
X: Don't care, -: No change
93CS44-115
2004-02-10
TMP93CS44/S45
(4) Application examples of capture function Used capture function, they can be applied in many ways, for example: 1. One-shot pulse output from external trigger pulse 2. Frequency measurement 3. Pulse width measurement 4. Time difference measurement 1. One-shot pulse output from external trigger pulse Set to T4MOD = 01. Set the up counter UC4 in free-running mode with the internal input clock, input the external trigger pulse from TI4 pin, and load the value of up counter into capture register CAP1 at the rise edge of the TI4 pin. When the interrupt INT4 is generated at the rise edge of TI4 input, set the CAP1 value (c) plus a delay time (d) to TREG4 (= c + d), and set the above set value (c + d) plus a one-shot pulse width (p) to TREG5 (= c + d + p). When the interrupt INT4 occurs the T4FFCRregister should be set "11" and that the TFF4 inversion is enabled only when the up counter value matches TREG4 or TREG5. When interrupt INTTR5 occurs, this inversion will be disabled after one-shot pulse is output. The (c), (d) and (p) correspond to c, d and p in Figure 3.8.13.
Set the counter in free-running mode. Count clock (Internal clock) TI4 pin input (External trigger pulse) Match with TREG4 Match with TREG5 Inversion enable Disables inversion caused by loading of the up counter value into CAP1. Delay time (d) INTTR5 occurred Inversion enable c c+d c+d+p
Load the up counter value into capture register 1 (CAP1) INT4 occurred
Timer output pin TO4
Pulse width (p)
Figure 3.8.13 One-shot Pulse Output (with Delay)
93CS44-116
2004-02-10
TMP93CS44/S45
Setting example: To output 2 ms one-shot pulse with 3 ms delay to the external trigger pulse to TI4 pin
System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
Main setting Keep counting (Free runnig) Count with T1 T4MOD - - 1 0 1 0 0 1 Load the up counter value into CAP1 at the rise edge of TI4 pin input. T4FFCR X X 0 0 0 0 1 0 Clear TFF4 to 0. Disable TFF4 inversion. P4CR P4FC INTE45 INTET54 TRUN - - - 1 1 - - 1 - - - - X 0 0 - XX1 --- 00 X- 0 1 XX- 110 1 - 00 -- Select P44 as the TO4 pin. Enable INT4, and disable INTTR4 and INTTR5. Start timer 4.
Setting of INT4 TREG4 TREG5 T4FFCR CAP1 + 3 ms/T1 TREG4 + 2 ms/T1 X X - - 1 1 -
- Enable TFF4 inversion when the up counter value matches TREG4 or TREG5.
INTET54
1
1
0
0
-
-
-
-
Enable INTTR5.
Setting of INTTR5 T4FFCR X X - - 0 0- - Disable TFF4 inversion when the up counter value matches TREG4 or TREG5. Disable INTTR5.
INTET54
1
1
0
0
-
-
-
-
X: Don't care, -: No change
When delay time is unnecessary, invert timer flip-flop (TFF4) when the up counter value is loaded into capture register 1 (CAP1), and set the CAP1 value (c) plus the one-shot pulse width (p) to TREG5 when the interrupt INT4 occurs. The TFF4 inversion should be enabled when the up counter (UC4) value matches TREG5, and disabled when generating the interrupt INTTR5.
93CS44-117
2004-02-10
TMP93CS44/S45
Count clock (Internal clock) TI4 pin input (External trigger pulse) c c+p Load the up counter value into capture register 1 (CAP1). INT4 occurred INTTR5 occurred Load the up-counter value into capture register 2 (CAP2).
Match with TREG5 Inversion enable Timer output pin TO4 Pulse width (p) Enables inversion caused by loading of the up counter value into CAP1. Disables inversion caused by loading of the up counter value into CAP2.
Figure 3.8.14 One-shot Pulse Output (without Delay) 2. Frequency measurement The frequency of the external clock can be measured in this mode. The clock is input through the TI4 pin, and its frequency is measured by the 8-bit timers (Timer 0 and timer 1) and the 16-bit timer/event counter (Timer 4). The TI4 pin input should be selected for the input clock of Timer 4. Set to T4MOD = 11. The value of the up counter is loaded into the capture register CAP1 at the rise edge of the timer flip-flop (TFF1) of 8-bit timers (Timer 0 and timer 1), and into CAP2 at its fall edge. The frequency is calculated by the difference between the loaded values in CAP1 and CAP2 when the interrupt (INTT0 or INTT1) is generated by either 8-bit timer.
Count clock (Internal clock) C1 TFF1 Loading UC16 into CAP1 Loading UC16 into CAP2 INTT0/INTT1 C1 C2 C1 C2 C2
Figure 3.8.15 Frequency Measurement For example, if the value for the level "1" width of TFF1 of the 8-bit timer is set to 0.5 seconds and the difference between CAP1 and CAP2 is 100, the frequency will be 100 / 0.5 [s] = 200 [Hz].
93CS44-118
2004-02-10
TMP93CS44/S45
3. Pulse width measurement This mode allows to measure the "H" level width of an external pulse. While keeping the 16-bit timer/event counter counting (Free running) with the internal clock input, the external pulse is input through the TI4 pin. Then the capture function is used to load the UC4 values into CAP1 and CAP2 at the rising edge and falling edge of the external trigger pulse respectively. The interrupt INT4 occurs at the falling edge of TI4. The pulse width is obtained from the difference between the values of CAP1 and CAP2 and the internal clock cycle. For example, if the internal clock is 0.8 microseconds and the difference between CAP1 and CAP2 is 100, the pulse width will be 100 x 0.8 s = 80 s. Additionally, the pulse width which is over the UC4 maximum count time specified by the clock source can be measured by changing software.
Count clock (Internal clock) C1 TI4 pin (External pulse) Loading UC16 into CAP1 Loading UC16 into CAP2 INT4 C1 C2 C1 C2 C2
Figure 3.8.16 Pulse Width Measurement Note: Only in this pulse width measuring mode (T4MOD = 10), external interrupt INT4 occurs at the falling edge of TI4 pin input. In other modes, it occurs at the rising edge.
The width of "L" level can be measured by multiplying the difference between the first C2 and the second C1 at the second INT interrupt and the internal clock cycle together. See Figure 3.8.17 "Time Difference Measurement".
93CS44-119
2004-02-10
TMP93CS44/S45
4. Time difference measurement This mode is used to measure the difference in time between the rising edges of external pulses input through TI4 and TI5. Keep the 16-bit timer/event counter (Timer 4) counting (Free running) with the internal clock, and load the UC4 value into CAP1 at the rising edge of the input pulse to TI4. Then the interrupt INT4 is generated. Similarly, the UC4 value is loaded into CAP2 at the rising edge of the input pulse to TI5, generating the interrupt INT5. The time difference between these pulses can be obtained from the difference between the time counts at which loading the up counter value into CAP1 and CAP2 was performed. (= (CAP2 - CAP1) x the internal clock cycle.)
Count clock (Internal clock) C1 TI4 pin input TI5 pin input Loading UC16 into CAP1 Loading UC16 into CAP2 INT4 INT5 Time difference C2
Figure 3.8.17 Time Difference Measurement
93CS44-120
2004-02-10
TMP93CS44/S45
3.9
Serial Channel
TMP93CS44/TMP93CS45 contains 2 serial I/O channels for full duplex asynchronous transmission (UART) as well as for I/O extension. The serial channel has the following operation modes. I/O interface mode (Channel 0 and 1) UART mode (Channel 0 and 1) Mode 0: To transmit and receive I/O data using the synchronizing signal SCLK for extending I/O. Mode 1: 7-bit data Mode 2: 8-bit data Mode 3: 9-bit data
In mode 1 and mode 2, a parity bit can be added. Mode 3 has wakeup function for making the master controller start slave controllers in serial link (Multi-controller system). Figure 3.9.1 shows the data format (for one frame) in each mode. Serial channel 0 and 1 can be used independently. * Mode 0 (I/O interface mode)
Bit0 1 2 3 4 5 6 7
Transfer direction
* Mode 1 (7-bit UART mode)
No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 Stop Parity Stop
* Mode 2 (8-bit UART mode)
No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Stop Parity Stop
* Mode 3 (9-bit UART mode)
Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 Stop
Bit8 Stop (Wakeup)
When bit8 = 1, address (Select code) is denoted. When bit8 = 0, data is denoted.
Figure 3.9.1 Data Formats
93CS44-121
2004-02-10
TMP93CS44/S45
The serial channel has a buffer register for transmitting and receiving operations, in order to temporarily store transmitted or received data, so that transmitting and receiving operations can be done independently (Full duplex). However, in I/O interface mode, SCLK (Serial clock) pin is used for both transmission and receiving, the channel becomes half duplex. The receiving data register is of a double buffer structure to prevent the occurrence of overrun error and provides one frame of margin before CPU reads the received data. The receiving data register stores the already received data while the buffer register receives the next frame data. By using CTS and RTS (there is no RTS pin, so any 1 port must be controlled by software), it is possible to halt data send until the CPU finishes reading receive data every time a frame is received (Handshake function). In the UART mode, a check function is added not to start the receiving operation by error start bits due to noise. The channel starts receiving data only when the start bit is detected to be normal at least twice in three samplings. When the transmission buffer becomes empty and requests the CPU to send the next transmission data, or when data is stored in the receiving data register and the CPU is requested to read the data, INTTX or INTRX interrupt occurs. Besides, if an overrun error, parity error, or framing error occurs during receiving operation, flag SC0CR/SC1CR will be set. The serial channel 0/1 includes a special baud rate generator, which can set any baud rate by dividing the frequency of 4 clocks (T0, T2, T8, and T32) from the internal prescaler (shared by 8- or 16-bit timer) by the value 1 to 16. In addition, serial channel 0/1 can operated by using external input clock (SCLK). In I/O interface mode, it is possible to input synchronous signals as well as to transmit or receive data by external clock.
93CS44-122
2004-02-10
TMP93CS44/S45 3.9.1 Control registers
The serial channel 0 is controlled by 3 control registers SC0CR, SC0MOD and BR0CR. Transmitted and received data are stored in register SC0BUF. The serial channel 1 has same registers (SC1CR, SC1MOD, BR1CR and SC1BUF). Serial Channel 0 Mode Control Register 7
SC0MOD (0052H) Bit symbol Read/Write After reset Function Undefined
Transfer data bit8
6
CTSE0 0
Handshake function 0: CTS0 disable 1: CTS0 enable
5
RXE 0
Receiving function 0: Receive disable 1: Receive enable
4
WU R/W 0
Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
TB8
Serial transmission mode 00: I/O interface mode 01: 7-bit UART 10: 8-bit UART 11: 9-bit UART
Serial transmission clock (UART) 00: TO2 Trigger 01: Baud rate generator 0 10: Internal clock 1 11: External clock (SCLK0 input)
Serial transmission clock (for UART mode) 00 Timer 2 match detect signal 01 10 11 Baud rate generator Internal clock 1 (fSYS) External clock (SCLK0 input)
Serial transmission mode 00 I/O Interface mode 01 10 11 UART 7-bit length 8-bit length 9-bit length
Wakeup function (Don't care in the modes other than 9-bit UART) 0 Disable 1 Enable
Receiving function 0 Receive disable 1 Receive enable
Transmission data bit8 8-bit UART mode Stores transmission (Parity) parity bit 9-bit UART mode Stores transmission data bit8
Handshake function ( CTS0 pin) 0 Disable (Always transferable) 1 Enable
Figure 3.9.2 Serial Channel 0 Related Register (1/7)
93CS44-123
2004-02-10
TMP93CS44/S45
Serial Channel 0 Control Register 7
SC0CR (0051H) Bit symbol Read/Write After reset Function RB8 R Undefined
Received data bit8
6
EVEN R/W 0
Parity 0: Odd 1: Even
5
PE 0
Parity addition 0: Disable 1: Enable
4
OERR 0
3
PERR 0
1: Error
2
FERR 0 (
1
SCLKS R/W 0
0: SCLK0
0
IOC 0 ) )
0: Baud rate generator 1: SCLK0 pin input
R (Cleared to "0" when read)
1: SCLK0 Overrun Parity Framing
(
Serial transmission clock (for I/O interface mode) (Note 1) 0 Baud rate generator 1 SCLK0 pin input
Edge selection in SCLK pin input mode Transmits and receives ( ) data at 0 rise edge of SCLK 1 Transmits and receives ( fall edge of SCLK ) data at
Framing error flag Parity error flag Overrun error flag
Cleared to 0 when read. (Note 2)
Enable parity addition 0 Prohibition (Disable) 1 Permission (Enable)
Addition/check of even parity 0 Odd parity 1 Even parity
Receving data bit8 8-bit UART mode (Parity) 9-bit UART mode
Stores received parity bit Stores received data bit8
Note 1: Note 2:
To use baud rate generator, set TRUN to 1, putting the prescaler in RUN mode. As all error flags are cleared after reading, do not test only a single bit with a bit testing instruction.
Figure 3.9.3 Serial Channel 0 Related Register (2/7)
93CS44-124
2004-02-10
TMP93CS44/S45
Baud Rate Generator 0 Control Register 7
BR0CR (0053H) Bit symbol Read/Write After reset Function - R/W 0 Always write "0". 00: 01: 10: 11: 0 T0 T2 T8 T32 0 0
6
5
BR0CK1
4
BR0CK0
3
BR0S3 R/W
2
BR0S2 0
1
BR0S1 0
0
BR0S0 0
Setting of the divided frequency
Setting of the divided frequency of baud rate generator 0000 16 divisions 0001 to 1111 1 division (not divided) to 15 divisions (Note 2)
Selecting the input clock of baud rate generator 00 Internal clock T0 01 10 11 Note 1: Note 2: Note 3: Note 4: Internal clock T2 Internal clock T8 Internal clock T32
To use baud rate generator, set TRUN to 1, putting the prescaler in RUN mode. "1 division" of baud rate generator can be used only UART mode. Do not set it in I/O interface mode. Bit6 of BR0CR is read as 1. Don't read from or write to BR0CR register during sending or receiving.
Serial Channel 0 Buffer Register 7
SC0BUF (0050H) Prohibit readmodifywrite Bit symbol Read/Write After reset RB7 TB7
6
RB6 TB6
5
RB5 TB5
4
RB4 TB4
3
RB3 TB3
2
RB2 TB2
1
RB1 TB1
0
RB0 TB0
R (Receiving)/W (Transmission) Undefined
Figure 3.9.4 Serial Channel 0 Related Registers (3/7)
93CS44-125
2004-02-10
TMP93CS44/S45
Serial Channel 1 Mode Control Register 7
SC1MOD (0056H) Bit symbol Read/Write After reset Function Undefined 0 0
Receiving function 0: Receive disable 1: Receive enable
6
CTSE1
5
RXE
4
WU R/W 0
Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
TB8
Transferred Handshake function data 0: CTS1 bit8 disable 1: CTS1 enable
Serial transmission mode 00: I/O interface mode 01: 7-Bit UART 10: 8-Bit UART 11: 9-Bit UART
Serial transmission clock (UART) 00: TO2 trigger 01: Baud rate generator 10: Internal clock 1 11: External clock (SCLK1 input)
Serial transmission clock (for UART mode) 00 Timer 2 match detect signal 01 10 11 Baud rate generator Internal clock 1 (fSYS) External clock (SCLK1 input)
The clock selection for the I/O interface mode is controlled by the serial control register (SC1CR). Serial transmission mode 00 Serial transmission mode 01 10 11 UART mode 7-bit length 8-bit length 9-bit length
Wakeup function (Don't care in the modes other than 9-bit UART) 0 Disable 1 Enable
Receiving control 0 Receive disable 1 Receive enable
Transmission data bit8 Stores transmission 8-bit UART mode (Parity) parity bit 9-bit UART mode Stores transmission data bit8
Handshake function ( CTS1 pin) 0 Disable (Always transferable) 1 Enable
Figure 3.9.5 Serial Channel 1 Related Register (4/7)
93CS44-126
2004-02-10
TMP93CS44/S45
Serial Channel 1 Control Register 7
SC1CR (0055H) Bit symbol Read/Write After reset Function RB8 R Undefined
Received data bit8
6
EVEN R/W 0
Parity 0: Odd 1: Even
5
PE 0
Parity addition 0: Disable 1: Enable
4
OERR 0
3
PERR 0
1: Error
2
FERR 0 (
Framing
1
SCLKS R/W 0
0: SCLK1
0
IOC 0 ) )
0: Baud rate generator 1: SCLK1 Pin input
R (Clear to "0" when read)
1: SCLK1 Overrun Parity
(
Serial transmission clock (for I/O interface mode) (Note1) 0 Baud rate generate 1 SCLK1 pin input
Edge selection in SCLK pin input mode Transmits and receives ( ) data at 0 rise edge of SCLK 1 Transmits and receives ( fall edge of SCLK ) data at
Framing error flag Parity error flag Overrun error flag Enable parity addition 0 Disable 1 Enable
Cleared to 0 when read (Note 2)
Addition/check of even parity 0 Odd parity 1 Even parity
Receiving data bit8 8-bit UART mode (Parity) 9-bit UART mode
Stores transmission parity bit Stores transmission data bit8
Note 1: Note 2:
To use baud rate generator, set TRUN to 1, putting the prescaler in RUN mode. As all error flags are cleared after reading, do not test only a single bit with a bit testing instruction.
Figure 3.9.6 Serial Channel 1 Related Register (5/7)
93CS44-127
2004-02-10
TMP93CS44/S45
Baud Rate Generator 1 Control Register 7
BR1CR (0057H) Bit symbol Read/Write After reset Function - R/W 0 Always write "0". 00: 01: 10: 11: 0 T0 T2 T8 T32 0 0
6
5
BR1CK1
4
BR1CK0
3
BR1S3 R/W
2
BR1S2 0
1
BR1S1 0
0
BR1S0 0
Setting of the divided frequency
Setting of the divided frequency of baud rate generator 0000 16 divisions 0001 to 1111 1 division (not divided) to 15 divisions (Note 2)
Selecting the input clock of baud rate generator 00 Internal clock T0 01 10 11 Note 1: Note 2: Note 3: Note 4: Internal clock T2 Internal clock T8 Internal clock T32
To use baud rate generator, set TRUN to "1", putting the prescaler in RUN mode. "1 division" of baud rate generator can be used only UART mode. Do not set it in I/O interface mode. Bit6 of BR1CR is read as "1". Don't read from or write to BR1CR register during sending or receiving.
Serial Channel 1 Buffer Register 7
SC0BUF (0054H) Prohibit readmodifywrite Bit symbol Read/Write After reset RB7 TB7
6
RB6 TB6
5
RB5 TB5
4
RB4 TB4
3
RB3 TB3
2
RB2 TB2
1
RB1 TB1
0
RB0 TB0
R (Receiving)/W (Transmission) Undefined
Figure 3.9.7 Serial Channel 1 Related Registers (6/7)
93CS44-128
2004-02-10
TMP93CS44/S45
Port 6 Function Register 7
P6FC (0016H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
5
P65F W 0 0: Port 1: SCLK1
4
3
P63F W 0 0: Port 1: TXD1
2
P62F 0 0: Port 1: SCLK0
1
0
P60F W 0 0: Port 1: TXD0
Setting TXD0 output P60 0 Port 1 TXD0 output (Channel 0)
Setting SCLK0 output P62 0 Port 1 SCLK0 output (Channel 0)
Setting TXD1 output P63 0 Port 1 TXD1 output (Channel 1)
Setting SCLK1 output P65 0 Port 1 SCLK1 output (Channel 1)
Open-drain Enable Register 7
ODE (0058H) Bit symbol Read/Write After reset Function 0 P34 0: CMOS 1: Open drain 0 P33 0: CMOS 1: Open drain
6
5
4
3
ODE34
2
ODE33 R/W
1
ODE63 0 P63 0: CMOS 1: Open drain
0
ODE60 0 P60 0: CMOS 1: Open drain
Setting P33 as open-drain output 0 CMOS output 1 Open-drain output
Setting P60 as open-drain output 0 CMOS output 1 Open-drain output
Setting P34 as open-drain output 0 CMOS output 1 Open-drain output
Setting P63 as open-drain output 0 CMOS output 1 Open-drain output
Note: Bit7 to 4 of ODE are read as 1.
Figure 3.9.8 Serial Channel Related Registers (7/7)
93CS44-129
2004-02-10
TMP93CS44/S45 3.9.2 Configuration
Figure 3.9.9 shows the block diagram of the serial channel 0.
Serial clock generation circuit BR0CR External clock TO2TRG T0 T2 T8 T32
(Timer 2 comparator output)
Prescaler
Selector
Selector
UART mode Selector
SIOCLK
Baud rate generator System clock fSYS (1)
SC0MOD Selector /2 SC0MOD I/O interface mode
SCLK0 input (Shared with P62)
SC0CR SCLK0 output (Shared with P62) Receive counter (Only UART / 16) RXDCLK SC0MOD Receive control (Only UART / 16) SC0CR RXD0 (Shared with P61) Receive buffer 1 (Shift register) Parity control SC0MOD INTRX0 INTTX0 Transmission counter (Only UART / 16) TXDCLK Transmission control (Only UART / 16)
Serial channel interrupt control
CTS0
(Shared with P62) SC0MOD
RB8 Receive buffer 2 (SC0BUF)
Error flag
TB8
Transmission buffer (SC0BUF)
TXD0 (Shared with P60)
SC0CR Internal data bus
Figure 3.9.9 Block Diagram of the Serial Channel 0
93CS44-130
2004-02-10
TMP93CS44/S45
Figure 3.9.10 shows the block diagram of the serial channel 1.
Serial clock generation circuit BR1CR T0 T2 T8 T32 Prescaler Selector Selector External clock TO2TRG
(Timer 2 comparator output)
UART mode Selector
SIOCLK
Baud rate generator System clock/fSYS (1) SCLK1 input (Shared with P65)
SC1MOD Selector t /2 SC1MOD I/O interface mode
SC1CR SCLK1 output (Shared with P65) Receive counter (Only UART / 16) RXDCLK SC1MOD Receive control (Only UART / 16) SC1CR RXD1 (Shared with P64) Receive buffer 1 (Shift register) Parity control SC1MOD INTRX1 INTTX1 Transmission counter (Only UART / 16) TXDCLK Transmission control (Only UART / 16)
Serial channel interrupt control
CTS1
(Shared with P65) SC1MOD
RB8 Receive buffer 2 (SC1BUF)
Error flag
TB8
Transmission buffer (SC1BUF)
TXD1 (Shared with P63)
SC1CR Internal data bus
Figure 3.9.10 Block Diagram of the Serial Channel 1
93CS44-131
2004-02-10
TMP93CS44/S45
1. Prescaler There are 9-bit prescaler and prescaler clock selection registers to generate input clock for 8-bit timer 0, 1, 2, 3, 16-bit timer 4, 5, and serial interface 0, 1. Figure 3.9.11 shows the block diagram. Table 3.9.1 shows prescaler clock resolution into the baud rate generator.
to CPU System clock fSYS 9-bit prescaler 2 4 8 16 32 64 128 256 512
/2 fFPH
Selector
/4
T1 T4 T16 T256 T1 T4 T16 1 T0 T2 T8 T32
To 8-bit timer 0, 1, 2 and 3
XT1
fs
TRUN SYSCR1 Selector /2
Selector
SYSCR0 Run/stop and clear
To 16-bit timer 4 and 5
To serial interface 0 and 1
fc
fc/2
fc/4
fc/8 fc/16
X1
/2 /4 /8 /16
SYSCR1
Figure 3.9.11 The Block Diagram of Prescaler Table 3.9.1 Prescaler Clock Resolution to Baud Rate Generator
at fc = 20 MHz, fs = 32.768 kHz
Select System Select Prescaler Gear Value Clock Clock
1 (fs) XXX 000 (fc) 0 (fc) 00 (fFPH) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16) XXX 01 (Low-frequency clock) 10 (Note) (fc/16 clock) XXX
Prescaler Output Clock Resolution
1 fs/2 (61 s)
2
T0
4
T2
6
T8
8
T32 fs/2 (7.8 s) fc/28 (12.8 s) fc/29 (25.6 s) fc/210(51.2 s) fc/211(102.4 s) fc/212(204.8 s) fs/28 (7.8 s) fc/212(204.8 s)
fs/2 (122 s) fs/2 (488.5 s) fs/2 (1.95 s) fc/24 (0.8 s) fc/25 (1.6 s) fc/2 (3.2 s)
6 7 8
fc/2 (0.1 s) fc/22 (0.2 s) fc/22 (0.2 s) fc/23 (0.4 s) fc/2 (0.4 s) fc/2 (0.8 s)
3 4 5 4 5 6
fc/26 (3.2 s) fc/27 (6.4 s) fc/2 (12.8 s)
8 9
fc/2 (0.8 s) fc/2 (1.6 s) fc/2 (1.6 s) fc/2 (3.2 s) - - - -
fc/2 (6.4 s) fc/2 (12.8 s)
fc/2 (25.6 s) fc/2 (51.2 s)
10
fs/24 (488.5 s) fs/26 (1.95 s) fc/28 (12.8 s) fc/210 (51.2 s)
XXX
XXX
XXX: Don't care, -: Can not use Note: The fc/16 clock as a prescaler prescaler clock can not be used when the fs is used as a system clock.
93CS44-132
2004-02-10
TMP93CS44/S45
The clock selected among fFPH clock, fc/16 clock, and fs clock is divided by 4 and input to this prescaler. This is selected by prescaler clock selection register SYSCR0. Resetting sets to "00" and selects the fFPH clock input divided by 4. The baud rate generator selects between 4 clock inputs: T0, T2, T8, and T32 among the prescaler outputs. The prescaler can be run or stopped by the timer operation control register TRUN. Counting starts when is set to "1", while the prescaler is cleared to zero and stops operation when is set to "0". When the IDLE1 mode (operates only oscillator) is used, set TRUN to "0" to reduce the power consumption of this prescaler before "HALT" instruction is executed. 2. Baud rate generator Baud rate generator comprises a circuit that generates transmission and receiving clocks to determine the transfer rate of the serial channel. The input clock to the baud rate generator, T0, T2, T8, or T32 is generated by the 9-bit prescaler which is shared by the timers. One of these input clocks is selected by the baud rate generator control register BR0CR. The baud rate generator includes a 4-bit frequency divider, which divides frequency by 1 to 16 values to determine the transfer rate. How to calculate a transfer rate when the baud rate generator is used is explained below. * UART mode Input clock of baud rate generator / 16 Frequency divisor of baud rate generator I/O interface mode Baud rate = Baud rate = Input clock of baud rate generator /2 Frequency divisor of baud rate generator
*
Accordingly, when source clock fc is 12.288 MHz, input clock is T2 (fc/16), and frequency divisor is 5, the transfer rate in UART mode becomes as follows:
System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
Baud rate =
fc/16 / 16 5 = 12.288 x 106 / 16 / 5 / 16 = 9600 (bps)
The maximum baud rate of this baud rate generator is 307.2 kbps. Table 3.9.2 shows an example of the transfer rate in UART mode. Also with 8-bit timer 2, the serial channel can get a transfer rate. Table 3.9.3 shows an example of baud rate using timer 2.
93CS44-133
2004-02-10
TMP93CS44/S45
Table 3.9.2 Selection of UART Transfer Rate (1) (when baud rate generator is used)
Unit (kbps)
fc [MHz]
9.830400
Input Clock
Frequency Divisor 1 2 4 8 16
T0 (4/fc)
153.600 76.800 38.400 19.200 9.600 38.400 19.200 230.400 76.800 38.400 19.200 38.400 19.200 153.600 76.800 38.400 19.200
T2 (16/fc)
38.400 19.200 9.600 4.800 2.400 9.600 4.800 57.600 19.200 9.600 4.800 9.600 4.800 38.400 19.200 9.600 4.800
T8 (64/fc)
9.600 4.800 2.400 1.200 0.600 2.400 1.200 14.400 4.800 2.400 1.200 2.400 1.200 9.600 4.800 2.400 1.200
T32 (256/fc)
2.400 1.200 0.600 0.300 0.150 0.600 0.300 3.600 1.200 0.600 0.300 0.600 0.300 2.400 1.200 0.600 0.300
12.288000 14.745600
5 10 1 3 6 12
17.2032 19.6608
7 14 2 4 8 16
Note 1: Transfer rate in I/O interface mode is 8 times faster than the values given in the above table. Note 2: This table is calculated when fc is selected as a system clock, fc/1 as a clock gear, and the system clock as a prescaler clock. Table 3.9.3 Selection of UART Transfer Rate (2) (when timer 2 (input clock T1) is used)
Unit (kbps)
fc TREG2
1H 2H 3H 4H 5H 8H AH 10H 14H
19.6608 MHz
153.6 76.8 51.2 38.4 30.72 19.2 15.36 9.6 7.68
14.7456 MHz
115.2 57.6 38.4 28.8 23.04 14.4 11.52 7.2 5.76
12.288 MHz
96 48 32 24 19.2 12 9.6 6 4.8
12 MHz
9.8304 MHz
76.8 38.4
8 MHz
62.5 31.25
6.144 MHz
48 24 16 12 9.6 6 4.8 3 2.4
31.25 19.2 9.6 4.8
How to calculate the transfer rate (when timer 2 is used): Transfer rate = The clock frequency selected by the register SYSCR0 TREG2 x 8 x 16 (when timer 2 (input clock T1) is used) Note 1: Timer 2 match detect signal cannot be used as the transfer clock in I/O interface mode. Note 2: This table is calculated when fc is selected as a system clock, fc/1 as a clock gear, and the system clock as a prescaler clock.
93CS44-134
2004-02-10
TMP93CS44/S45
3. Serial clock generation circuit This circuit generates the basic clock for transmitting and receiving data. * I/O interface mode When in SCLK output mode with the setting of SC0CR = 0, the basic clock will be generated by dividing by 2 the output of the baud rate generator described before. When in SCLK input mode with the setting of SC0CR = 1, the rising edge or falling edge will be detected according to the setting of SC0CR register to generate the basic clock. * UART mode According to the setting of SC0MOD, the above baud rate generator clock, internal clock 1 (Max 625 kbps at fc = 20 MHz), the match detect signal from timer 0, or external clock SCLK0 will be selected to generate the basic clock SIOCLK. 4. Receiving counter The receiving counter is a 4-bit binary counter used in UART mode and counts up by SIOCLK clock. 16 pulses of SIOCLK are used for receiving 1 bit of data, and the data bit is sampled three times at 7th, 8th and 9th clock. With the three samples, the received data is evaluated by the rule of majority. For example, if the sampled data bit is "1", "0" and "1" at 7th, 8th and 9th clock respectively, the received data is evaluated as "1". The sampled data "0", "0" and "1" is evaluated that the received data is "0". 5. Receiving control * I/O interface mode When in SCLK output mode with the setting of SC0CR = 0, RXD0 signal will be sampled at the rising edge of shift clock which is output to SCLK0 pin. When in SCLK input mode with the setting SC0CR = 1 RXD0 signal will be sampled at the rising edge or falling edge of SCLK0 input according to the setting of SC0CR register. * UART mode The receiving control has a circuit for detecting the start bit by the rule of majority. When two or more "0" are detected during 3 samples, it is recognized as start bit and the receiving operation is started. Data being received are also evaluated by the rule of majority.
93CS44-135
2004-02-10
TMP93CS44/S45
6. Receiving buffer To prevent overrun error, the receiving buffer has a double buffer structure. Received data are stored one bit by one bit in the receiving buffer 1 (Shift register type). When 7 bits or 8 bits of data is stored in the receiving buffer 1, the stored data are transferred to the receiving buffer 2 (SC0BUF), generating an interrupt INTRX0. The CPU reads only receiving buffer 2 (SC0BUF). Even before the CPU reads the receiving buffer 2 (SC0BUF), the received data can be stored in the receiving buffer 1. However, unless the receiving buffer 2 (SC0BUF) is read before all bits of the next data are received by the receiving buffer 1, an overrun error occurs. If an overrun error occurs, the contents of the receiving buffer 1 will be lost, although the contents of the receiving buffer 2 and SC0CR is still preserved. The parity bit added in 8-bit UART mode and the most significant bit (MSB) in 9-bit UART mode are stored in SC0CR. When in 9-bit UART mode, the wakeup function of the slave controllers is enabled by setting SC0MOD to 1, and interrupt INTRX0 occurs only when SC0CR is set to 1. 7. Transmission counter Transmission counter is a 4-bit binary counter which is used in UART mode and, counts by SIOCLK clock, generating TXDCLK every 16 clock pulses.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Figure 3.9.12 Generation of Transmission Clock 8. Transmission controller * I/O interface mode In SCLK0 output mode with the setting of SC0CR = 0, the data in the transmission buffer are output bit by bit to TXD0 pin at the rising edge of shift clock which is output from SCLK0 pin. In SCLK0 input mode with the setting of SC0CR = "1", the data in the transmission buffer are output bit by bit to TXD0 pin at the rising edge or falling edge of SCLK0 input according to the setting of SC0CR register. * UART mode When transmission data are written in the transmission buffer sent from the CPU, transmission starts at the rising edge of the next TXDCLK, generating a transmission shift clock TXDSFT.
93CS44-136
2004-02-10
TMP93CS44/S45
Handshake function The serial channels use the CTS0 pin to transmit data in units of frames, thus preventing an overrun error. Use SC0MOD to enable or disable the handshake function. When CTS0 goes high, data transmission is halted after the completion of the current transmission and is not restarted until CTS0 returns to low. An INTTX0 interrupt is generated to request the CPU for the next data to transmit. When the CPU write the data to the transmit buffer, processing enters standby mode. An RTS pin is not provided, but a handshake function can easily be configured if the receiver sets any port assigned to the RTS function to high (in the receive interrupt routine) after data receive, and requests the transmitter to temporarily halt transmission.
TMP93CS44/S45
TMP93CS44/S45
TXD
CTS
RXD
RTS (Any port)
Sender
Receiver
Figure 3.9.13 Handshake Function
Timing to write Transmission buffer
CTS0
Send is suspended
Note 1 Note 2
13 SIOCLK TXDCLK TXD
14
15
16
1
2
3
4
14
15
16
1
2
3
Start bit
Bit0
Note 1:
If the CTS signal rises during transmission, the next data is not sent after the completion of the current transmission.
Note 2:
Transmission starts at the first TXDCLK clock fall after the CTS signal falls.
Figure 3.9.14 Timing of CTS (Clear to send)
93CS44-137
2004-02-10
TMP93CS44/S45
9. Transmission buffer Transmission buffer (SC0BUF) shifts out and sends the transmission data written from the CPU from the least significant bit (LSB) in order. When all bits are shifted out, the transmission buffer becomes empty and generates INTTX0 interrupt. 10. Parity control circuit When serial channel control register SC0CRis set to 1, it is possible to transmit and receive data with parity. However, parity can be added only in 7- or 8-bit UART mode. With SC0CR register, even (odd) parity can be selected. For transmission, parity is automatically generated according to the data written in the transmission buffer SC0BUF, and data are transmitted after being stored in SC0BUF when in 7-bit UART mode while in SC0MOD when in 8-bit UART mode. and must be set before transmission data are written in the transmission buffer. For receiving, data are shifted in the receiving buffer 1, and parity is added after the data are transferred in the receiving buffer 2 (SC0BUF), and then compared with SC0BUF when in 7-bit UART mode and with SC0MOD when in 8-bit UART mode. If they are not equal, a parity error occurs, and SC0CR flag is set. 11. Error flag Three error flags are provided to increase the reliability of receiving data. 1. Overrun error If all bits of the next data are received in receiving buffer 1 while valid data are stored in receiving buffer 2 (SC0BUF), an overrun error will occur. 2. Parity error The parity generated for the data shifted in receiving buffer 2 (SC0BUF) is compared with the parity bit received from RXD pin. If they are not equal, a parity error occurs. 3. Framing error The stop bit of received data is sampled three times around the center. If the majority is 0, a framing error occurs.
93CS44-138
2004-02-10
TMP93CS44/S45
12.
Signal generation timing
1) In UART mode Mode
Timing for Interrupt Generation Timing for Framing Error Generation Timing for Parity Error Generation Timing for Overrun Error Generation
Receive
9-Bit
Center of last bit (Bit8) Center of stop bit - Center of last bit (Bit8)
8-Bit + Parity
Center of last bit (Parity bit) Center of stop bit Center of last bit (Parity bit) Center of last bit (Parity bit)
8-Bit, 7-Bit + Parity, 7-Bit
Center of stop bit Center of stop bit Center of stop bit Center of stop bit
Note:
In 9-bit and 8-bit + parity mode, interrupts coincide with the ninth bit pulse. Thus, when serving the interrupt, it is necessary to want for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error.
Send Mode
Timing for Interrupt Generation
9-Bit
Immediately before stop bit sent
8-Bit + Parity
8-Bit, 7-Bit + Parity, 7-Bit
2)
In I/O interface mode
SCLK0 output mode SCLK0 input mode SCLK0 output mode SCLK0 input mode Immediately after rise of last SCLK0 signal (See Figure 3.9.17) Immediately after rise (Rising mode) or fall (Falling mode) of last SCLK0 signal (See Figure 3.9.18) Immediately after final SCLK0 (when received data are transferred to receive buffer 2 (SC0BUF) (See Figure 3.9.19) Immediately after final SCLK0 (when received data are transferred to receive buffer 2 (SC0BUF) (See Figure 3.9.20)
Timing for Send Interrupt Generation
Timing for Receive Interrupt Generation
93CS44-139
2004-02-10
TMP93CS44/S45 3.9.3 Operational description
(1) Mode 0 (I/O interface mode) This mode is used to increase the number of I/O pins of for transmitting or receiving data to or from the external shifter register. This mode includes SCLK output mode to output synchronous clock SCLK0 and SCLK input mode to input external synchronous clock SCLK0.
Output extension TMP93CS44/S45 Shift register A TXD SCLK Port SI SCK RCK B C D E F G H RXD SCLK Port QH CLOCK S/ L Input extension TMP93CS44/S45 Shift register A B C D E F G H
TC74HC595 or the like
TC74HC165 or the like
Figure 3.9.15 Example of SCLK Output Mode Connection
Output port extension TMP93CS44/S45 Input port extension TMP93CS44/S45 A TXD SCLK Port SI SCK RCK B C D E F G H RXD SCLK Port QH CLOCK S/ L
Shift register
Shift register A B C D E F G H
TC74HC595 or the like External clock
TC74HC165 or the like External clock
Figure 3.9.16 Example of SCLK Input Mode Connection
93CS44-140
2004-02-10
TMP93CS44/S45
1. Transmission In SCLK output mode, 8-bit data and synchronous clock are output from TXD0 pin and SCLK0 pin, respectively, each time the CPU writes data in the transmission buffer. When all data is output, INTES0 will be set to generate INTTX0 interrupt.
Timing to write transmission data SCLK0 output
TXD0
Bit0
Bit1
Bit6
Bit7
TXDSFT ITX0C (INTTX0 interrupt request)
Figure 3.9.17 Transmitting Operation in I/O Interface Mode (SCLK output mode)
In SCLK output mode, 8-bit data are output from TXD0 pin when SCLK0 input becomes active while data are written in the transmission buffer by CPU. When all data are output, INTES0 will be set to generate INTTX0 interrupt.
SCLK0 input (SCLKS = 0: Rising edge mode) SCLK0 input (SCLKS = 1: Falling edge mode) TXD0 Bit0 Bit1 Bit5 Bit6 Bit7
TXDSFT ITX0C (INTTX0 interrupt request)
Figure 3.9.18 Transmitting Operation in I/O Interface Mode (SCLK input mode)
93CS44-141
2004-02-10
TMP93CS44/S45
2. Receiving In SCLK output mode, synchronous clock is outputted from SCLK0 pin and the data are shifted in the receiving buffer 1 whenever the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data are received, the data will be transferred in the receiving buffer 2 (SC0BUF) at the timing shown below, and INTES0 will be set again to generate INTRX0 interrupt.
IRX0C
SCLK0
RXD0 Timing to shift data in the receiving buffer 2
Bit0
Bit1
Bit2
Bit6
Bit7 Generate INTRX0
Figure 3.9.19 Receiving Operation in I/O Interface Mode (SCLK output mode)
In SCLK input mode, the data is shifted in the receiving buffer 1 when SCLK input becomes active while the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data is received, the data will be shifted in the receiving buffer 2 (SC0BUF) at the timing shown below, and INTES0 will be set again to generate INTRX0 interrupt.
SCLK0 input (SCLKS = 0: Rising edge mode) SCLK0 input (SCLKS = 1: Falling edge mode) RXD0 Timing to shift data in the receiving buffer 2 Bit0 Bit1 Bit2 Bit6 Bit7 Generate INTRX0
Figure 3.9.20 Receiving Operation in I/O Interface Mode (SCLK input mode) Note: For data receiving, the system must be placed in the receive enable state (SC0MOD = 1).
93CS44-142
2004-02-10
TMP93CS44/S45
(2) Mode 1 (7-bit UART mode) 7-bit UART mode can be set by setting serial channel mode register SC0MOD to 01. In this mode, a parity bit can be added, and the addition of a parity bit can be enabled or disabled by serial channel control register SC0CR, and even parity or odd parity is selected by SC0CR when is set to 1 (Enable).
Setting example: When transmitting data with the following format, the control registers should be set as described below. Start Bit 0 1 2 3 4 5 6
Even parity
Stop
Direction of transmission (Transmission rate: 2400 bps at fc = 12.288 MHz) System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
* Clock condition
7 P6CR P6FC SC0MOD SC0CR BR0CR TRUN INTES0 SC0BUF - X X X 0 1 1 *
65 -- X 0 1 X X 1 * - - 1 1 - 0 *
4 - X X X 0 - 0 *
3 - - 0 X 0 - - *
2 - - 1 X 1 - - *
1 - X 0 0 0 - - *
0 1 1 1 0 1 - - * Select P60 as the TXD pin. Set 7-bit UART mode. Add an even parity. Set transfer rate at 2400 bps. Start the prescaler for the baud rate generator. Enable INTTX0 interrupt and set interrupt level 4. Set data for transmission.
X: Don't care, -: No change
(3) Mode 2 (8-bit UART mode) 8-bit UART mode can be specified by setting SC0MOD to 10. In this mode, parity bit can be added, the addition of a parity bit is enabled or disabled by SC0CR, and even parity or odd parity is selected by SC0CR when is set to 1 (Enable).
Setting example: When receiving data with the following format, the control register should be set as described below. Start Bit0 1 2 3 4 5 6 7
Odd parity
Stop
Direction of transmission (Transmission rate: 9600 bps at fc = 12.288 MHz)
* Clock condition
System clock: High frequency (fs) Clock gear: 1 (fc) Prescaler clock: fFPH
93CS44-143
2004-02-10
TMP93CS44/S45
Main setting 7 P6CR SC0MOD SC0CR BR0CR TRUN INTES0 - - X 0 1 - 6 - 0 0 X X - 5 4 3 - 1 X 0 - 1 2 - 0 X 1 1 0 0 0 0 0 - 1 0 1 - 0 Select P61 (RXD) as the input pin. Enable receiving in 8-bit UART mode. Add an odd parity. Set transfer rate at 9600 bps. Start the prescaler for the baud rate generator. Enable INTRX0 interrupt and set interrupt level 4. -- 1X 1X 01 - - - -
-- 10
X: Don't care, -: No change Interrupt processing ACC SC0CR AND 00011100 if ACC 0 then ERROR ACC SC0BUF Check for error. Read the received data.
(4) Mode 3 (9-bit UART mode) 9-bit UART mode can be specified by setting SC0MOD to 11. In this mode, parity bit cannot be added. For transmission, the MSB (9th bit) is written in SC0MOD, while in receiving it is stored in SC0CR. For writing and reading the buffer, the MSB is read or written first then SC0BUF. Wakeup function In 9-bit UART mode, the wakeup function of slave controllers is enabled by setting SC0MOD to 1. The interrupt INTRX0 occurs only when = 1.
TXD Master
RXD
TXD Slave 1
RXD
TXD Slave 2
RXD
TXD Slave 3
RXD
Note:
TXD pin of the slave controllers must be in open drain output mode.
Figure 3.9.21 Serial Link Using Wakeup Function
93CS44-144
2004-02-10
TMP93CS44/S45
Protocol 1. 2. 3. Select the 9-bit UART mode for the master and slave controllers. Set SC0MOD bit of each slave controller to 1 to enable data receiving. The master controller transmits one-frame data including the 8-bit select code for the slave controllers. The MSB (Bit8) is set to 1.
Start Bit0 1 2 3 4 5 6 7 8 "1" Stop
Select code of slave controller
4. 5.
Each slave controller receives the above frame, and clears bit to 0 if the above select code matches its own select code. The master controller transmits data to the specified slave controller whose SC0MOD bit is cleared to 0. The MSB (Bit8) is cleared to 0.
Start Bit0 1 2 3 Data 4 5 6 7 Bit8 "0" Stop
6.
The other slave controllers (with the bit remaining at 1) ignore the receiving data because their MSBs (Bit8 or ) are set to 0 to disable the interrupt INTRX0. The slave controllers ( = 0) can transmit data to the master controller, and it is possible to indicate the end of data receiving to the master controller by this transmission.
93CS44-145
2004-02-10
TMP93CS44/S45
Setting example: To link two slave controllers serially with the master controller, and use the internal clock 1 as the transfer clock.
TXD Master
RXD
TXD Slave 1
RXD
TXD Slave 2
RXD
Select code 00000001
Select code 00001010
Since serial channels 0 and 1 operate in exactly the same way, channel 0 is used for the purposes of explanation. *
Main P6CR P6FC INTES0 SC0MOD SC0BUF - - - - - - - 1 0 1 X X - 1 1 0 1 0 X- 01 1 0 X1 01 0 1 Select P60 as TXD0 pin and P61 as RXD0 pin. Enable INTTX0 and set the interrupt level 4. Enable INTRX0 and set the interrupt level 5. Set 1 as the transmission clock in 9-bit UART mode. Set the select code for slave controller 1.
Setting the master controller
010 000
11 00
INTTX0 interrupt SC0MOD SC0BUF 0 * - * - * - * - * - * - * - * Sets TB8 to "0". Set data for transmission.
*
Main P6CR P6FC ODE INTES0 SC0MOD
Setting the slave controller 2
- - - - - - - - 0 - 1 1 0 0 Enable INTRX0 and INTTX0. Set to "1" in the 9-bit UART transmission mode with transfer clock 1.
X X - 1 0 1 0
X- 1 1
X1
X X X X - 01 11
Select P61 as RXD0 pin and P60 as TXD0 pin (Open-drain output).
11 11
INTRX0 interrupt ACC SC0BUF if ACC = Select code Then SC0MOD - - - 0 - - - -
Clear to "0".
93CS44-146
2004-02-10
TMP93CS44/S45
3.10 Serial Bus Interface (SBI)
The TMP93CS44/S45 has a 1-channel serial bus interface which employs a clocked synchronous 8-bit serial bus interface and an I2C bus. The serial bus interface is connected to an external device through P33 (SDA) and P34 (SCL) in the I2C bus mode; and through P32 (SCK), P33 (SO), and P34 (SI) in the clocked synchronous 8-bit SIO mode. TMP93CS44/S45 has no an arbitration function which is necessary when two or more master devices scramble for the bus control. In master mode, other devices which are connected on the same bus need be slave devices (Single master). Setting of every pins is as follows.
ODE
I2C Bus Mode Clock Synchronous 8-Bit SIO Mode 11 XX
P3CR P3FC
11X 011 010 X110 1111
X: Don't care
3.10.1
Configuration
INTS2 interrupt request SCL SCK SIO clock control Input/ output control P32 (SCK/ HWR )
fc/4
Divider Transfer
I C bus clock synchronous + Control
2
SIO data control
SO SI
P33 (SO/SDA)
control circuit Shift register I2C bus data control P34 (SI/SCL) Noise canceller SDA
Noise canceller
SBICR2/ SBISR SBI control register 2/ SBI status register
I2CAR I2C bus address register
SBIDBR SBI data buffer register
SBICR1 SBI control register 1
SBICR3 SBI control register 3
Figure 3.10.1 Serial Bus Interface (SBI)
93CS44-147
2004-02-10
TMP93CS44/S45 3.10.2 Serial bus interface (SBI) control
The following registers are used for control and operation status monitoring when using the serial bus interface (SBI). * * * * * * Serial bus interface control register 1 (SBICR1) Serial bus interface control register 2 (SBICR2) Serial bus interface control register 3 (SBICR3) Serial bus interface data buffer register (SBIDBR) I2C bus address register (I2CAR) Serial bus interface status register (SBISR)
The above registers differ depending on an mode to be used. Refer to section 3.10.4 "I2C Bus Mode Control" and 3.10.6 "Clock Synchronous 8-Bit SIO Mode Control".
3.10.3
The Data Formats in the I2C Bus Mode
The data formats when using the TMP93CS44/S45 in the I2C bus mode are shown below. (a) Addressing format
8 bits 1 RA /C WK 1 to 8 bits Data 1 A C K 1 or more 1 to 8 bits Data 1 A CP K
S
Slave address 1
(b) Addressing format (with restart)
8 bits S Slave address 1 1 RA /C WK 1 to 8 bits Data 1 or more 1 A CS K 8 bits Slave address 1 1 RA /C WK 1 to 8 bits Data 1 or more 1 A CP K
(c) Free data format
8 bits S Data 1 S: Start condition 1 A C K 1 to 8 bits Data 1 A C K 1 or more 1 to 8 bits Data 1 A CP K
R/ W : Direction bit ACK: Acknowledge bit P: Stop condition
2
Figure 3.10.2 Data Format in the I C Bus Mode
93CS44-148
2004-02-10
TMP93CS44/S45 3.10.4 I2C Bus Mode Control
The following registers are used for control and operation status monitoring when using the serial bus interface (SBI) in the I2C bus mode. Serial Bus Interface Control Register 1 7
SBICR1 (004BH)
Prohibit
6
BC1 W 0
5
BC0 0
4
ACK R/W 0
Acknowledge mode specification
3
2
SCK2 0
1
SCK1 W 0
0
SCK0 0
Bit symbol Read/Write After reset
BC2 0
read-modify- Function write
Number of transferred bits (Note 1)
Serial clock selection (Note 2)
Serial clock selection - kHz 000 N = 4 - kHz 001 N = 5 - kHz 010 N = 6 74.6 kHz 011 N = 7 38.2 kHz 100 N = 8 19.3 kHz N=9 101 9.71 kHz N = 10 110 (Reserved) 111
System clock: fc Clock gear: fc/1 fc = 20 MHz (Output on SCL pin)
Acknowledge mode specification 0 Not generate clock pulse for acknowledge signal 1 Generate clock pulse for acknowledge signal
Number of transferred bits = 0 Number of Bits Clock 000 8 8 001 1 1 010 2 2 011 3 3 100 4 4 101 5 5 110 6 6 111 7 7 Note 1: Note 2: Note 3: Set to "000" before switching to a clock synchronous 8-bit SIO mode. Refer to sentence of 3.10.4 (3) "Serial clock".
= Number of Clock 9 2 3 4 5 6 7 8
1 Bits 8 1 2 3 4 5 6 7
This I2C bus circuit does not support high-speed mode. It supports standard mode only.
2
Figure 3.10.3 Register for I C Bus Mode (1/4)
93CS44-149
2004-02-10
TMP93CS44/S45
Serial Bus Interface Control Register 2 7
SBICR2 (004EH)
Prohibit readmodifywrite
6
TRX W (R/W 0
Transmitter/ receiver selection
5
BB
Note 1
4
PIN 1
Cancel INTS2 request
3
SBIM1 W 0
2
SBIM0 0
1
0
Bit symbol Read/Write After reset Function
MST 0
Master/ slave selection
)
0
Start/stop condition generation
Serial bus interface operating mode selection (Note 2)
SBI operating mode selection 00 Port mode (Serial bus interface output disable) 01 10 11 SIO mode I2C bus mode (Reserved)
Cancel INTS2 request 0- 1 Cancel interrupt service request
Start/stop condition generation 0 Generate the stop condition 1 Generate the start condition
Transmitter/receiver selection 0 Receiver 1 Transmitter
Master/slave selection 0 Slave 1 Note 1: Note 2: This register functions as the SBISR by reading. Switch a mode to the port mode after confirming that the bus is free. Switch a mode to the I2C bus mode and the clocked-synchronous 8-bit SIO mode after confirming that input signals via port are high level.
2
Master
Figure 3.10.4 Register for I C Bus Mode (2/4)
93CS44-150
2004-02-10
TMP93CS44/S45
Serial Bus Interface Status Register 7
SBISR (004EH) Bit symbol Read/Write After reset Prohibit readmodifywrite Function 0 Master/ slave selection status monitor 0 0 Transmitter/ I2C bus status receiver monitor selection status monitor 1 INTS2 request status monitor MST
6
TRX
5
BB
4
PIN R
3
AL 0
Noise detection monitor
2
AAS 0
Slave address match detection monitor
1
AD0 0
GENERAL CALL detection monitor
0
LRB 0
Last received bit monitor
Last received bit monitor 0 Last received bit "0" 1 Last received bit "1"
GENERAL CALL detection monitor 0 Non GENERAL CALL detected 1 GENERAL CALL detected
Slave address match detection monitor Non slave address match or 0 GENERAL CALL detected 1 Slave address match or GENERAL CALL detected
Noise detection monitor 0 Non noise detected 1 Noise detected
INTS2 request status 0 Interrupt service requested 1
2
Interrupt service cancelled
I C bus status monitor 0 Bus free 1 Bus busy
Transmitter/receiver selection status monitor 0 Receiver 1 Transmitter
Master/slave selection status monitor 0 Slave 1 Note: Bits 7 to 2 of this register function as the SBICR2 by writing.
2
Master
Figure 3.10.5 Register for I C Bus Mode (3/4)
93CS44-151
2004-02-10
TMP93CS44/S45
Serial Bus Interface Control Register 3 7
SBICR3 (004FH) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
SWRST R/W 0
Software reset 0: Don't care 1: Initialize SBI
Software reset 0 Don't care 1 Initialize SBI (after initializing SBI, SWRST is automatically cleared to "0").
Serial Bus Interface Data Buffer Register 7
SBIDBR (004CH) Prohibit readmodify -write Bit symbol Read/Write After reset Note 1: Note 2: DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receive)/W (Send) Undefined
When writing the send data, start from the MSB (Bit7). Receiving data is placed from LSB (Bit0). SBIDBR can't be read the written data. Therefore read-modify-write instruction (e.g., "BIT" instruction) is prohibitted.
Note 3:
Written data in SBIDBR is cleared by INTS2 signal.
I C Bus Address Register 7
I2CAR (004DH) Bit symbol Read/Write After reset Prohibit read-modify -write Function 0 0 SA6
2
6
SA5
5
SA4
4
SA3 W
3
SA2
2
SA1 0
1
SA0 0
0
ALS 0
Address recognition mode specification
0 0 0 Slave address selection.
Address recognition mode specification 0 Slave address recognition 1
2
Non slave address recognition
Figure 3.10.6 Register for I C Bus Mode (4/4)
93CS44-152
2004-02-10
TMP93CS44/S45
(1) Acknowledge mode specification Set SBICR1 to "1" for operation in the acknowledge mode. The TMP93CS44/S45 generates an additional clock pulse for an acknowledge signal when operating in the master mode. In the transmitter mode during the clock pulse cycle, the SDA pin is released in order to receive the acknowledge signal from the receiver. In the receiver mode during the clock pulse cycle, the SDA pin is set to the low level in order to generate the acknowledge signal. Set to 0 for operation in the non-acknowledge mode. The TMP93CS44/S45 does not generate a clock pulse for the acknowledge signal when operating in the master mode. In the acknowledgment mode, when the TMP93CS44/S45 is the slave mode, clocks are counted for the acknowledge signal. During the clock for the acknowledge signal, when a received slave address matches to a slave address set to the I2CAR or a GENERAL CALL is received, the SDA pin is set to low level generating an acknowledge signal. After a received slave address matches to a slave address set to the I2CAR and a GENERAL CALL is received, in the transmitter mode during the clock for the acknowledge signal, the SDA pin is released in order to receive the acknowledge signal from the receiver. In the receiver mode, the SDA pin is set to low level generating an acknowledge signal. In the non-acknowledgment mode, when the TMP93CS44/S45 is the slave mode, clocks for the acknowledge signal are not counter. (2) Number of transfer bits SBICR1 are used to select a number of bits for transmitting and receiving data. Since are cleared to 000 as a start condition, a slave address and direction bit transmissions are executed in 8 bits. Other than these, retain a specified value. (3) Serial clock 1. Clock source SBICR1 are used to select a maximum transfer frequency output on the SCL pin in the master mode. Set the baud rates, which have been calculated according to the formula below, to meet the specifications of the I2C bus, such as the smallest pulse width of tLOW.
tHIGH tLOW 1/fscl
tLOW = 2n/fFPH tHIGH = 2n/fFPH + 12/fFPH fscl = 1/(tLOW + tHIGH) fFPH = 2 x 2n + 12
(Bits 2 to 0 in the SBICR1) 000 001 010 011 100 101 110
n 4 5 6 7 8 9 10
Figure 3.10.7 Clock Source
93CS44-153
2004-02-10
TMP93CS44/S45
2. Clock synchronization The I2C bus has a clock synchronization function to meet the transfer speed to a slow processing device when a transfer is performed between device which have different process speed. The clock synchronization functions when the SCL pin is high level and the SCL line of the bus is low level in the serial bus interface circuit. The serial bus interface circuit waits counting a clock pulse in high level until the SCL line of the bus is high level. When the SCL line of the bus is high level, the serial bus interface circuit starts counting during high level. The clock synchronization function holds clocks which are output from the serial interface circuit to be high level. The slave device can stop the clock output of the master device on one word or one bit basis. Additionally, the transfer speed by the master device matches to the process speed of the slave device.
SCL pin (Master device) SCL pin (Slave device) SCL (Bus) Wait Start counting high-level width of a clock pulse
Figure 3.10.8 Clock Synchronization (4) Slave address and address recognition mode specification To operate the TMP93CS44/S45 in the addressing format which recognizes the slave address, set I2CAR to 0 and set the slave address to the I2CAR. To operate the serial bus interface circuit in the free data format which does not recognize the slave address, set to 1. When the TMP93CS44/S45 used in the free data format, the slave address and the direction bit are not recognized. They are handled as data just after generation of start conditions. (5) Master/slave selection Set SBICR2 to 1 for operating the TMP93CS44/S45 as a master device. is cleared to 0 by the hardware after a stop condition on a bus is detected.
93CS44-154
2004-02-10
TMP93CS44/S45
(6) Transmitter/receiver selection Set SBICR2 to 1 for operating the TMP93CS44/S45 as a transmitter. Set to 0 for operation as a receiver. When data with an addressing format is transferred in the slave mode, when a slave address with the same value that an I2CAR or the GENERAL CALL is received (All 8-bit data are 0 after the start condition), is set to 1 by the hardware if the direction bit (R/W) sent from the master device is 1, and is set to 0 by the hardware if the bit is 0. In the master mode, after the acknowledge signal is returned from the slave device, is set to 0 by the hardware if a transmitted direction bit is 1, and set to 1 by the hardware if it is 0. When the acknowledge signal is not returned, the current condition is maintained. is cleared to 0 by the hardware after the stop condition on the I2C bus is detected. The following shows change conditions in each mode and after changing. after Changing
0 1 1 0
Mode
Slave Mode Master Mode
Direction Bit
0 1 0 1
Change Condition
A received slave address is the same as a value set to I2CAR. ACK signal is returned.
When the TMP93CS44/S45 operates in the free data format, the slave address and the direction bit are not recognized. They are handled as data just after generating a start condition. The TRX was not changed by the hardware. (7) Start/stop condition generation When SBICR2 is 0, the start condition and slave address and direction bit are output by writing 1 to SBICR2. It is necessary to set 1 to SBICR1 beforehand.
SCL line SDA line Start condition 1 A6 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8 R/ W Acknowledge signal 9
Slave address and the direction bit
Figure 3.10.9 Start Condition Generation and Slave Address Generation When SBICR2 is 1, a sequence of generating the stop condition is started by writing 1 to and 0 to . Do not modify the contents of until the stop condition is generated on a bus. When a stop condition is generated and the SCL line on the bus is set to low level by another device, a stop condition is generated after releasing the SCL line.
93CS44-155
2004-02-10
TMP93CS44/S45
SCL line SDA line Stop condition
Figure 3.10.10 Stop Condition Generation The bus condition can be indicated by reading the contents of . is set to 1 when the start condition on a bus is detected, and is set to 0 when the stop condition is detected. (8) Cancel interrupt service request When the TMP93CS44/S45 is the master mode and transferring a number of clocks set by the SBICR1 and the SBICR1 is complete, a serial bus interface interrupt request (INTS2) is generated. In the slave mode, the INTS2 is generated when the received slave address is the same as the value set to the I2CAR and an acknowledge signal is output, when a GENERAL CALL is received and an acknowledge signal is output, or when transferring/receiving data is complete after the received slave address is the same as the value set to the I2CAR and a GENERAL CALL is received. When the serial bus interface interrupt request occurs, the SBISR is cleared to 0. During the time that the PIN is 0, the SCL pin is set to low level. Either writing or reading data to or from the SBIDBR sets the to 1. The time from the being set to 1 until the SCL pin is released takes tLOW. Although the can be set to 1 by the program, the is not cleared to 0 when it is written 0. (9) Serial bus interface operation mode selection SBICR2 is used to specify the serial bus interface operation mode. Set to 10 when used in the I2C bus mode after confirming that input signal via port is high level. Switch a mode to port after making sure that a bus is free. (10) Noise detection monitor The I2C bus is easy to be affected by noise, because the bus is driven by the open drain and the pull-up resistor. With the TMP93CS44/S45, the SDA pin output and the SDA line level are compared at a rise of the SCL line on the bus, and whether data are output correctly on the bus is detected only in the master transmitter mode. When the SDA pin output differs from the SDA line level, the SBISR is set to 1. When the AL is set to 1, the SDA pin is released and the MST and the TRX are cleared to 0 by the hardware. The TMP93CS44/S45 changes to the slave receiver mode, and continues outputting clocks unit transferring data when the AL was set to 1 is completed. Either writing or reading data to or from the SBIDBR, or writing data to the SBICR2 clears to the AL to 0.
93CS44-156
2004-02-10
TMP93CS44/S45
SCL (Bus) SDA pin SDA (Bus) Noise Noise detection
Figure 3.10.11 Noise Detection Monitor (11) Slave address match detection monitor SBISR is set to 1 in the slave mode, in the address recognition mode (I2CAR = 0) when receiving the GENERAL CALL or the slave address with the same value that is set to the I2CAR. When is 1, is set to 1 after receiving the first 1 word of data. is set to 0 by writing/reading data to/from a data buffer register. (12) GENERAL CALL detection monitor SBISR is set to 1 in the slave mode, when the GENERAL CALL is received (All 8-bit data are 0 after the start condition). is set to 0 when the start or stop condition is detected on a bus. (13) Last received bit monitor The SDA line value stored at the rising edge of the SCL line is sent to SBISR. In the acknowledge mode, immediately after the INTS2 interrupt request is generated, the acknowledge signal is read by reading the contents of . (14) Software reset function Software reset function is used to initialize the SBI which is rocked by external noise, etc. When SBICR3 is set to 1, the internal reset signal pulse is generated and inputted into the SBI circuit. All command registers and state registers are initialized to initial values. is automatically set to 0 after the SBI circuit is initialized. (15) Serial bus interface data buffer register (SBIDBR) The SBIDBR register can read out the receiving data and write the sending data. After the start condition generated in the master mode, set the slave address and the direction bit in this register. (16) I2C bus address register (I2CAR) I2CAR sets the slave address when the TMP93CS44/S45 are operated as the slave devices. Setting I2CAR = 0, the slave address output from master device is recognized, and the data format is changed to the addressing format. Setting I2CAR = 1, the slave address is not recognized, and the data format is changed to the free data format.
93CS44-157
2004-02-10
TMP93CS44/S45 3.10.5 Data Transfer in I2C Bus Mode
(1) Device initialization First, set SBICR1. Specify 0 to bits 7 to 5 and 3 in the SBICR1. Set the slave address and to I2CAR ( = 0 when the addressing format). Subsequently, set 0 to ; 1 to ; 10 to ; and 0 to bits 0 and 1 in the SBICR2. The slave receiver mode is set. Note: The initialization of the serial bus interface circuit must be complete within the time from all devices which are connected to the bus have initialized to any device does not generate a start condition. If not, there is a possibility that another device starts transferring before an end of the initialization of the serial bus interface circuit. Data can not be received correctly.
(2) Start condition and slave address generation Confirm a bus free status (when SIBSR = 0). Set the SBICR1 to 1 and specify a slave address and a direction bit to be transmitted to the SBIDBR. When the SBISR is 0, the start condition are generated and the slave address and the direction bit which are set to the SBIDBR are output on a bus by wiring 1 to the SBICR2 and PIN. An INTS2 interrupt request occurs at the 9th falling edge of the SCL clock cycle, and the is cleared to 0. The SCL pin is pulled down to the low-level while the is 0. When an interrupt request occurs, the changes by the hardware according to the direction bit only when an acknowledge signal is returned from the slave device. Note : Do not write a slave address to be output to the SBIDBR while data are transferred. If data is written to the SBIDBR, data to been outputting may be destroyed.
SCL pin SDA pin 1 A6 Start condition INTS2 interrupt request 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8 R/ W Acknowledge signal from a slave device 9
Slave address + Direction bit
Figure 3.10.12 Start Condition Generation and Slave Address Transfer
93CS44-158
2004-02-10
TMP93CS44/S45
(3) 1-word data transfer Test SBISR by the INTS2 interrupt process after a 1-word data transfer is completed, and determine whether the mode is a master or slave. 1. When is "1" (Master mode) Test SBISR and determine whether the mode is a transmitter or receiver. When is "1" (Transmitter mode) Check SBISR. When is 1, a receiver does not request data. Implement the process to generate the stop condition (Described later) and terminate data transfer. When is 0, the receiver requests new data. When the next transmitted data is 8 bits, write it to the SBIDBR. When the next transmitted data is other than 8 bits, set SBICR1, set SBICR1 to 1, and write the transmitted data to the SBIDBR. After writing the data, SBISR becomes 1, the serial clock pulse is generated for transferring a new 1 word of data from the SCL pin, and then the 1-word data is transmitted. After the data is transmitted, the INTS2 interrupt request occurs. becomes 0 and the SCL pin is set to the low level. If the data to be transferred is more than one word in length, repeat the procedures from test mentioned above.
SCL pin Write to SBIDBR SDA pin D7 D6 D5 D4 D3 D2 D1 D0 Acknowledge signal from a receiver INTS2 interrupt request 1 2 3 4 5 6 7 8 9
Figure 3.10.13 Example of when = "000", = "1" (Transmitter mode) When is "0" (Receiver mode) When the next transmitted data is other than 8 bits, set SBICR1 again. Set to 1 and read the received data from the SBIDBR to release the SCL line. The read data is undefined immediately after the slave address is set. After the data is read, becomes 1. Serial clock pulse for transferring new 1 word of data is defined SCL and outputs "L" level from SDA pin with acknowledge timing. The INTS2 interrupt request then occurs and becomes 0. The SCL pin is set to the low level. The TMP93CS44/S45 outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that received data is read from the SBIDBR.
93CS44-159
2004-02-10
TMP93CS44/S45
Read SBIDBR SCL pin 1 2 3 4 5 6 7 8 9
SDA pin
D7
D6
D5
D4
D3
D2
D1
D0
New D7 Acknowledge signal to a transmitter
INTS2 interrupt request
Figure 3.10.14 Example of when = "000", = "1" (Receiver mode)
93CS44-160
2004-02-10
TMP93CS44/S45
In order to terminate the transmitting data to the transmitter, set to 0 before reading data which is 1 word before the last data to be received. The last data does not generate a clock pulse for the acknowledge signal. After the data is transmitted and an interrupt request has occurred, set to 001 and read the data. The TMP93CS44/S45 generates a clock pulse for a 1-bit data transfer. Since the master device is a receiver, the SDA line of the bus keeps the high level. The transmitter receives the high-level signal as the ACK signal. The receiver indicates to the transmitter that data transfer is complete. After 1-bit data is received and the interrupt request has occurred, the TMP93CS44/S45 generates the stop condition and terminates data transfer.
SCL pin 1 2 3 4 5 6 7 8 1
SDA pin
D7
D6
D5
D4
D3
D2
D1
D0 Acknowledge signal sent to a transmitter
INTS2 interrupt request "0" Read SBIDBR Output of master Output of slave "001" Read SBIDBR
Figure 3.10.15 Termination of Data Transfer in Master Receiver Mode
93CS44-161
2004-02-10
TMP93CS44/S45
2. When is "0" (Slave mode) In the slave mode, the TMP93CS44/S45 operates either in normal slave mode or in recovery process after a noise detection. In the slave mode, an INTS2 interrupt request occurs when the serial bus interface circuit receives a slave address or a GENERAL CALL from the master device, or when a GENERAL CALL is received and data transfer is complete after matching a received slave address. In the master mode, the TMP93CS44/S45 operates in a slave mode if a noise is detected. An INTS2 interrupt request occurs when word data transfer terminates after a noise detection. When an INTS2 interrupt request occurs, the SBISR is reset, and the SCL pin is set to low level. Either reading or writing from or to the SBIDBR or setting the to 1 releases the SCL pin after taking tLOW time. The TMP93CS44/S45 tests the SBISR, the SBISR, the , and the and implements processes according to conditions listed in the next table. Table 3.10.1 Operation in the Slave Mode
1

0

1 0
Conditions
Process
In the slave receiver mode, the Set the number of bits in 1 word to TMP93CS44/S45 receives a slave and write transmitted data to the SBIDBR. address of which the direction bit sent from the master is "1". In the slave transmitter mode, 1-word data is transmitted. Check . If is set to "1", set to "1" since the receiver does not request next data. Then, clear to "0" release the bus. If is set to "0", set the number of bits in a word to and write transmitted data to the SBIDBR since the receiver requests next data.
0
0
0
0
1
1/0
Read the SBIDBR for setting to "1" In the slave receiver mode, the (Reading dummy data) or write "1" to . TMP93CS44/S45 receives a slave address or GENERAL CALL of which the direction bit sent from the master is "0". Set the number of bits in a word to In the slave receiver mode, the TMP93CS44/S45 terminates receiving and read received data from the SBIDBR. of 1-word data.
0
1/0
93CS44-162
2004-02-10
TMP93CS44/S45
(4) Stop condition generation When SBISR is 1, a sequence of generating a stop condition is started by writing 1 to SBICR2, and 0 to . Do not modify the contents of until the stop condition is generated on the bus. When SBICR2 are written "1" and is written "0" (generate stop condition in master mode), changes to "0" by internal SCL changes to "1", without waiting stop condition. To check whether SCL and SDA pin are "1" by sensing their ports is needed to detect bus free condition.
"1" "1" "0" "1" Internal SCL SCL pin
Stop condition
SDA pin (Read)
Figure 3.10.16 Stop Condition Generation
93CS44-163
2004-02-10
TMP93CS44/S45
(5) Restart Restart is used to change the direction of data transfer between a master device and a slave device during transferring data. The following explains how to restart the TMP93CS44/S45. Clear 0 to the , , and and set 1 to the . The SDA pin retains the high level and the SCL pin is released. Since a stop condition is not generated on the bus, the bus is assumed to be in a busy state from other devices. And confirm SCL pin, that SCL pin is released and become bus-free state by SBISR = "0" or signal level "1" of SCL pin in port mode. Test the until it becomes 1 to check that the SCL line of the bus is not set to low level by other devices. After confirming that the bus stays in a free state, generate a start condition with procedure (2). In order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to confirm that the bus is free until the time to generate the start condition.
"0" "0" "0" "1" "1" "1" "1" "1" 4.7 s (Min) SCL (Bus) SCL pin SDA pin 9 Start condition
Figure 3.10.17 Timing Diagram when Restarting the TMP93CS44/S45
93CS44-164
2004-02-10
TMP93CS44/S45 3.10.6 Clock Synchronous 8-Bit SIO Mode Control
The following registers are used for control and operation status monitoring when using the serial bus interface (SBI) in the clock synchronous 8-bit SIO mode. Serial Bus Interface Control Register 1 7
SBICR1 (004BH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0
Indication transfer start/stop 0: Stop 1: Start
6
SIOINH W 0
Continue/ abort transfer 0: Continue 1: Abort
5
SIOM1 0
4
SIOM0 0
3
2
SCK2 0
1
SCK1 W 0
Serial clock selection
0
SCK0 0
SIOS
Transfer mode select 00: 8-bit transmit 01: (Reserved) 10: 8-bit transmit/receive 11: 8-bit receive
Serial clock selection 000 fc/25 (625 kHz) 001 010 011 100 101 110 111 fc/26 (312.5 kHz) fc/27 (156.3 kHz) System clock: fc fc/28 ( 78.13 kHz) Clock gear: fc/1 fc/29 ( 39.06 kHz) fc = 20 MHz (Output on SCK PIN) fc/210 ( 19.53 kHz) fc/211 ( 9.77 kHz) External clock (Input from SCK pin) Transfer mode select 00 8-bit transmit mode 01 10 11 Reserved 8-bit transmit/receive mode 8-bit receive mode
Continue/abort transfer 0 Continue transfer 1 Abort transfer (Automatically cleared after abort)
Indicate transfer start/stop 0 Stop 1 Start
Note:
Set to 0 and to 1 when setting the transfer mode and the serial clock.
Serial Bus Interface Data Buffer Register 7
SBIDBR (004CH) Prohibit readmodifywrite Bit symbol Read/Write After reset DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receive)/W (Send) Undefined
Figure 3.10.18 Registers for SIO Mode (1/2)
93CS44-165
2004-02-10
TMP93CS44/S45
Serial Bus Interface Control Register 2 7
SBICR2 (004EH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0
6
5
4
3
SBIM1 W
2
SBIM0 0
1
0
Serial bus interface operation mode selection 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
Serial bus interface operation mode selection 00 Port mode (Serial bus interface output disable) 01 10 11 SIO mode I2C bus mode (Reserved)
Note 1: Note 2:
Switch a mode to port after data transfer is complete. Switch a mode to SIO mode after confirming that input signals via port are high level.
Serial Bus Interface Status Register 7
SBISR (004EH) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0
Serial tarnsfer operating status monitor
6
5
4
3
SIOF R
2
SEF 0
Shift operating status monitor
1
0
Shift operating status monitor 0 Shift operation terminated 1 Shift operation in process
Serial transfer operating status monitor 0 Transfer terminated 1 Transfer in process
Figure 3.10.19 Registers for SIO Mode (2/2)
93CS44-166
2004-02-10
TMP93CS44/S45
(1) Serial clock 1. Clock source SBICR1 are used to select the following functions. Internal clock In the internal clock mode, any of seven frequencies can be selected. The serial clock is output to the outside on the SCK pin. The SCK pin becomes a high level when data transfer starts. When writing (in the transmit mode) or reading (in the receive mode) data cannot follow the serial clock rate, an automatic-wait function is executed to stop the serial clock automatically and hold the next shift operation until reading or writing is complete.
Automatic-wait function
SCK pin output SO pin output Write transmitted data a
1
2
3
7
8
1
2
6
7
8
1
2
3
a0 a1 a2 a5 a6 a7
b0 b1 b4 b5 b6 b7 c0 c1 c2 b c
Figure 3.10.20 Automatic-wait Function External clock ( = 111) An external clock supplied to the SCK pin is used as the serial clock. In order to ensure shift operation, a pulse width of at least 4 machine cycles is required for both high and low levels in the serial clock. The maximum data transfer frequency is 625 kHz. (fc = 20 MHz.)
SCK pin tSCKL tSCKH tSCKL, tSCKH > 4 tcyc tcyc: 4/fFPH (in NORMAL mode, IDLE mode)
Figure 3.10.21 External Clock
93CS44-167
2004-02-10
TMP93CS44/S45
2. Shift edge The leading edge is used to transmit data, and the trailing edge is used to receive data. Leading edge shift Data is shifted on the leading edge of the serial clock (at the falling edge of the SCK pin input/output). Trailing edge shift Data is shifted on the trailing edge of the serial clock (at the rising edge of the SCK pin input/output).
SCK pin SO pin Shift register
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
*******7
76543210 *7654321 **765432 ***76543 ****7654 *****765 ******76
(a) Leading edge
SCK pin SI pin Shift register
********
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
0*******
10******
210***** 3210**** 43210*** 543210** 6543210* 76543210
(b) Trailing edge *: Don't care
Figure 3.10.22 Shift Register
93CS44-168
2004-02-10
TMP93CS44/S45
(2) Transfer mode SBICR1 are used to select a transmit, receive, or transmit/receive mode. 1. 8-bit transmit mode Set a control register to a transmit mode and write data to the SBIDBR. After the data is written, set SBICR1 to 1 to start data transfer. The transmitted data is transferred from the SBIDBR to the shift register and output to the SO pin in synchronous with the serial clock, starting from the least significant bit (LSB). When the data is transferred to the shift register, the SBIDBR becomes empty. The INTS2 (Buffer empty) interrupt request is generated to request new data. When the internal clock is used, the serial clock will stop and automatic-wait function will be initiated if new data is not loaded to the data buffer register after the specified 8-bit data is transmitted. When new data is written, automatic-wait function is canceled. When the external clock is used, data should be written to the SBIDBR before new data is shifted. The transfer speed is determined by the maximum delay time between the time when an interrupt request is generated and the time when data is written to the SBIDBR by the interrupt service program. When the transmit is started, after SBISR goes 1 the same value as the final bit of the last data is output until the falling edge of the SCK. Transmitting data is ended by clearing to 0 with the buffer empty interrupt service program or setting SBICR1 to 1. When is cleared, the transmitted mode ends when all data is output. In order to confirm if data is surely transmitted by the program, set to be sensed. is cleared to 0 when transmitting is complete. When is set to 1, transmitting data stops. turns 0. When the external clock is used, it is also necessary to clear to 0 before new data is shifted; otherwise, dummy data is transmitted and operation ends.
93CS44-169
2004-02-10
TMP93CS44/S45
Clear SCK pin (Output) SO pin INTS2 interrupt request SBIDBR
a b
* a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
Write transmitted data (a) Internal clock Clear SCK pin (Input) SO pin INTS2 interrupt request
* a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
SBIDBR
a
b
Write transmitted data (b) External clock
Figure 3.10.23 Transfer Mode
Example: Program to stop transmitting data (when external clock is used). STEST1: BIT SEF, (SBISR) ; If = 1 then loop. JR NZ, STEST1 STEST2: BIT 2, (P3) ; If SCK = 0 then loop. JR Z, STEST2 LD (SBICR1), 00000111B ; 0.
93CS44-170
2004-02-10
TMP93CS44/S45
SCK pin SO pin
Bit6 Bit7
tSODH = Min 3.5/fFPH [s] (in NORMAL mode)
Figure 3.10.24 Transmitted Data Hold Time at End of Transmit 2. 8-bit receive mode Set the control register to a receive mode and SBICR1 to 1 for switching to the receive mode. Data is received from the SI pin to the shift register in synchronous with the serial clock, starting from the least significant bit (LSB). When the 8-bit data is received, the data is transferred from the shift register to the SBIDBR. The INTS2 (Buffer full) interrupt request is generated to request to read the received data. The data is then read from the SBIDBR by the interrupt service program. When the internal clock is used, the serial clock will stop and automatic-wait function will be initiated until the received data is read from the SBIDBR. When the external clock is used, since shift operation is synchronized with the clock pulse provided externally, the received data should be read from the SBIDBR before next serial clock input. If the received data is not read, further data to be received is canceled. The maximum transfer speed when the external clock is used is determined by the delay time between the time when an interrupt request is generated and the time when received data is read. Receiving data is ended by clearing to 0 with the buffer full interrupt service program or setting SBICR1 to 1. When is cleared, received data is transferred to the SBIDBR in complete blocks. The received mode ends when the transfer is complete. In order to confirm if data is surely received by the program, set SBISR to be sensed. is cleared to 0 when receiving is complete. After confirming that receiving has ended, the last data is read. When is set to 1, receiving data stops. turns 0 (the received data becomes invalid, therefore no need to read it). Note: When the transfer mode is switched, the SBIDBR contents are lost. In case that the mode needs to be switched, receiving data is concluded by clearing to 0, read the last data, and then switch the mode.
93CS44-171
2004-02-10
TMP93CS44/S45
Clear SCK pin (Output) SI pin INTS2 interrupt request SBIDBR
a b a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Read received data
Read received data
Figure 3.10.25 Receive Mode (Example: Internal clock) 3. 8-bit transmit/receive mode Set a control register to a transmit/receive mode and write data to the SBIDBR. After the data is written, set SBICR1 to 1 to start transmitting/receiving. When transmitting, the data is output from the SO pin on the leading edges in synchronous with the serial clock, starting from the least significant bit (LSB). When receiving, the data is input to the SI pin on the trailing edges of the serial clock. The 8-bit data is transferred from the shift register to the SBIDBR, and the INTS2 interrupt request occurs. The interrupt service program reads the received data from the data buffer register and writes data to be transmitted. The SBIDBR is used for both transmitting and receiving. Transmitted data should always be written after received data is read. When the internal clock is used, automatic-wait function is initiated until received data is read and next data is written. When the external clock is used, since the shift operation is synchronized with the external clock, received data is read and transmitted data is written before new shift operation is executed. The maximum transfer speed when the external clock is used is determined by the delay time between the time when an interrupt request is generated and the time when received data is read and transmitted data is written. When the transmit is started, after SBISR = 1 output from the SO pin holds final bit of last data until falling edge of the SCK. Transmitting/receiving data is ended by clearing to 0 by the INTS2 interrupt service program or setting SBICR1 to 1. When is cleared, received data is transferred to the SBIDBR in complete blocks. The transmit/receive mode ends when the transfer is complete. In order to confirm if data is surely transmitted/received by the program, set SBISR to be sensed. becomes 0 after transmitting/receiving is complete. When is set, transmitting/receiving data stops. turns 0. Note: When the transfer mode is switched, the SBIDBR contents are lost. In case that the mode needs to be switched, transmitting/receiving data is concluded by clearing to 0, read the last data, and then switch the transfer mode.
93CS44-172
2004-02-10
TMP93CS44/S45
Clear SCK pin (Output) SO pin SI pin INTS2 interrupt request SBIDBR
a c b d
* a0
a1 c1
a2 c2
a3 c3
a4 c4
a5 c5
a6 c6
a7 c7
b0 d0
b1 d1
b2 d2
b3 d3
b4 d4
b5 d5
b6 d6
b7 d7
c0
Write transmitted data (a)
Read received Write transmitted data (c) data (b)
Read received data (d)
Figure 3.10.26 Transmit/Receive Mode (Example: Internal clock)
SCK pin SO pin
Bit6 Bit7 in last transmitted word
tSODH = Min 4/fFPH [s] (in NORMAL mode)
Figure 3.10.27 Transmitted Data Hold Time at End of Transmit/Receive
93CS44-173
2004-02-10
TMP93CS44/S45
3.11 AD Converter
TMP93CS44/S45 incorporate a high-speed, high-precision 10-bit analog/digital converter (AD converter) with 8-channel analog input. Figure 3.11.1 is a block diagram of the AD converter. The 8-channel analog input pins (AN0 to AN7) are also used as input-only port 5 and can be also used as input ports.
Internal data bus
ADMOD1


ADMOD0


Scan Decoder Repeat Interrupt Busy End Start Channel select AD converter control circuit INTAD interrupt ADTRG
AN7 (P57) AN6 (P56) AN5 (P55) AN4 (P54) AN3/ ADTRG (P53) AN2 (P52) AN1 (P51) AN0 (P50) Analog input Multiplexer AD conversion result register ADREG04L to 37L ADREG04H to 37H
Sample hold
VREFH VREFL DA converter
Figure 3.11.1 Block Diagram of AD Converter Note 1: When the power supply current is reduced in IDLE2, IDLE1, STOP mode, there is possible to set a standby enabling the internal comparator due to a timing. Stop operation of AD converter before execution of "HALT" instruction. In regard to the lowest operation frequency. The operation of AD converter is guaranteed with clock of fFPH 4 MHz (Used fc clock). Is not guaranteed with fs clock.
Note 2:
93CS44-174
2004-02-10
TMP93CS44/S45 3.11.1 AD converter registers
AD converter is controlled by two AD mode control registers (ADMOD0 and ADMOD1). AD conversion result is stored in eight AD conversion result registers (ADREG04H/L, ADREG15H/L, ADREG26H/L, ADREG37H/L). AD Mode Control Register 0 7
ADMOD0 (005EH) Bit symbol Read/Write After reset Function 0
AD conversion end flag 0: Conversion in progress 1: Conversion end
6
AD8F R 0
AD conversion busy flag 1: Conversion is idle 1: Conversion in progress
5
- 0
4
- 0
3
ITM0 R/W 0
2
REPET 0
1
SCAN 0
0
ADS 0
AD conversion start 0: Don't care 1: Start conversion Always read as "0".
EOCF
Always write Always write Specifies Repeat mode Scan mode "0". interrupts for specification specification "0". fixed channel 0: Single 0: Fixed/repeat converchannel conversion sion mode mode mode. 1: Repeat 1: Channel 0: Every converscan mode conversion mode sion 1: Every four conversions
AD conversion start 0 Don't care 1 Start AD conversion
AD scan mode specification 0 AD conversion fixed-channel mode 1 AD conversion channel scan mode
AD repeat mode specification 0 AD single conversion mode 1 AD repeat conversion mode
AD specifies interrupts for fixed channel/repeat conversion mode Fixed channel/repeat conversion mode = "0", = "1" 0 1 Generates interrupt every conversion Generates interrupt every four conversions
AD conversion busy flag 0 AD conversion is idle 1 AD conversion in progress
AD conversion end flag 0 AD conversion in progress 1 AD conversion end
Figure 3.11.2 Register for AD Converter (1/4)
93CS44-175
2004-02-10
TMP93CS44/S45
AD Mode Control Register 1 7
ADMOD1 (005FH) Bit symbol Read/Write After reset Function VREFON R/W 1
String resistor 0: OFF 1: ON
6
5
4
3
ADTRGE 0
External trigger start control 0: Disable 1: Enable
2
ADCH2 R/W 0
1
ADCH1 0
Analog input channel selection
0
ADCH0 0
Analog input channel selection 000 001 010 011 (Note) 100 101 110 111 0 Channel fix AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 1 Channel scan AN0 AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN4 AN4 AN5 AN4 AN5 AN6 AN4 AN5 AN6 AN7
Conversion start control by external trigger ( ADTRG pin input) 0 Disable 1 Enable
Analog reference voltage control 0 OFF 1 ON
Set the bit to 1 before starting conversion (before writing 1 to ADMOD0). Note: As the AN3 and the ADTRG are the same pin, = 011 can't be set when is set to 1 and ADTRG is used.
Figure 3.11.3 Register for AD Converter (2/4)
93CS44-176
2004-02-10
TMP93CS44/S45
AD Conversion Result Register 0/4 Low 7
ADREG04L (0060H) Bit symbol Read/Write After reset Function ADR01 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR00
5
4
3
2
1
0
ADR0RF R 0
Conversion result tored flag 1: Exist result
AD Conversion Result Register 0/4 High 7
ADREG04H Bit symbol (0061H) Read/Write After reset Function ADR09
6
ADR08
5
ADR07
4
ADR06 R
3
ADR05
2
ADR04
1
ADR03
0
ADR02
Undefined Stores upper 8 bits of AD conversion result.
AD Conversion Result Register 1/5 Low 7
ADREG15L (0062H) Bit symbol Read/Write After reset Function ADR11 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR10
5
4
3
2
1
0
ADR1RF R 0
Conversion result stored flag 1: Exist result
AD Conversion Result Register 1/5 High 7
ADREG15H Bit symbol (0063H) Read/Write After reset Function 9 Channel x conversion result 8 7 6 ADR19
6
ADR18
5
ADR17
4
ADR16 R
3
ADR15
2
ADR14
1
ADR13
0
ADR12
Undefined Stores upper 8 bits of AD conversion result. 5 4 3 2 1 0
ADREGxH 765
4
3
2
1
0
7
6
5
4
3
2
ADREGxL 10
* Bits 5 to 1 are always read as 1. * Bit0 is conversion result stored flag bit . is set to 1 when the AD conversion result is stored. Reading either the ADREGxH or the ADREGxL registers clears to 0.
Figure 3.11.4 Register for AD Converter (3/4)
93CS44-177
2004-02-10
TMP93CS44/S45
AD Conversion Result Register 2/6 Low 7
ADREG26L (0064H) Bit symbol Read/Write After reset Function ADR21 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR20
5
4
3
2
1
0
ADR2RF R 0
Conversion result stored flag 1: Exist result
AD Conversion Result Register 2/6 High 7
ADREG26H Bit symbol (0065H) Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Undefined Stores upper 8 bits of AD conversion result.
AD Conversion Result Register 3/7 Low 7
ADREG37L (0066H) Bit symbol Read/Write After reset Function ADR31 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR30
5
4
3
2
1
0
ADR3RF R 0
Conversion result stored flag 1: Exist result
AD Conversion Result Register 3/7 High 7
ADREG37H Bit symbol (0067H) Read/Write After reset Function 9 Channel x conversion result 8 7 6 ADR39
6
ADR38
5
ADR37
4
ADR36 R
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Undefined Stores upper 8 bits of AD conversion result. 5 4 3 2 1 0
ADREGxH 765
4
3
2
1
0
7
6
5
4
3
2
ADREGxL 10
* Bits 5 to 1 are always read as 1. * Bit0 is conversion result stored flag bit . is set to 1 when the AD conversion result is stored. Reading either the ADREGxH or the ADREGxL registers clears to 0.
Figure 3.11.5 Register for AD Converter (4/4)
93CS44-178
2004-02-10
TMP93CS44/S45 3.11.2 Operation
(1) Analog reference voltage High analog reference voltage is applied to the VREFH pin, and low analog reference voltage is applied to the VREFL pin. The voltage between VREFH and VREFL is divided into 1024 increments using a string resistor. AD conversion is based on comparing the analog input voltage with these reference voltage increments. To turn the switch between VREFH and VREFL off, write 0 to the ADMOD1 bit. To start AD conversion when the switch is off, first write 1 to . After that, wait at 3 s long enough to get the stabilized oscillation, write 1 to ADMOD0. (2) Selecting analog input channels The procedure for selecting analog input channels depends on the operating mode of the AD converter. * When analog input channel is used to fix (ADMOD0 = 0) To set ADMOD1, selecting one channel from analog input pins AN0 to AN7. * When analog input channel is used to scan (ADMOD0 = 1) To set ADMOD1, selecting one channel from 8 scan mode. Table 3.11.1 shows the analog input channel selection each operating mode. A reset initializes ADMOD0 to 0 and ADMOD1 to 000, selecting pin AN0 for the AD converter input. The pins not used as analog input channels can be used as general-purpose input ports (P5). Table 3.11.1 Analog Input Channel Selection
000 001 010 011 100 101 110 111
Fixed channel = 0
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN0
Channel scan = 1
AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN4 AN4 AN5 AN4 AN5 AN6 AN4 AN5 AN6 AN7
(3) Starting AD conversion AD conversion starts when ADMOD0 to 1, or ADMOD1 is set to 1 and the falling edge is input through ADTRG pin. When AD conversion starts, AD conversion busy flag ADMOD0 is set to 1, indicating AD conversion is in progress. Writing 1 to while conversion is in progress restarts the conversion. Check the conversion result stored flag ADREGxL to determine whether the AD conversion data are valid at this time. Inputting the falling edge to the ADTRG pin while conversion is in progress is invalid.
93CS44-179
2004-02-10
TMP93CS44/S45
(4) AD conversion modes and completion interrupt Follow the four AD conversion modes are supported. * * * * Fixed channel single conversion mode Channel scan single conversion mode Fixed channel repeat conversion mode Channel scan repeat conversion mode
AD conversion mode can selected by setting AD mode control register ADMOD0. When AD conversion end, AD conversion completion interrupt INTAD request occurs. And the ADMOD0 flag is set to 1 to indicate that AD conversion has completed. 1. Fixed channel single conversion mode Fixed channel single conversion ADMOD0 to 00. mode can be specified by setting
In this mode, conversion of the specified single channel is executed once only. After conversion is completed, ADMOD0 is set to 1, ADMOD0 is cleared to 0 and occurs INTAD interrupt request. 2. Channel scan single conversion mode Channel scan single conversion ADMOD0 to 01. mode can be specified by setting
In this mode, conversion of the specified channel are executed once only. After conversion is completed, ADMOD0 is set to 1, ADMOD0 is cleared to 0 and occurs INTAD interrupt request. 3. Fixed channel repeat conversion mode Fixed channel repeat conversion ADMOD0 to 10. mode can be specified by setting
In this mode, conversion of the specified single channel is executed repeatedly. After conversion is completed, ADMOD0 is set to 1, ADMOD0 remains 1 not changed to 0. The timing of INTAD interrupt request can selected by setting of ADMOD0. When is set to 0, interrupt request occurs after every conversion. When is set to 1, interrupt request occurs after every fourth conversion. 4. Channel scan repeat conversion mode Channel scan repeat conversion ADMOD0 to 11. mode can be specified by setting
In this mode, specified channels are converted repeatedly. After every scan convert completion, ADMOD0 is set to 1 and INTAD interrupt request occurs. ADMOD0 remains 1, not changed to 0. To stop the repeat conversion mode (3. and 4.), write 0 to ADMOD0. After the current conversion is completed, repeat conversion mode is terminated, and ADMOD0 is cleared to 0. If the device enters the IDLE2, IDLE1 or STOP modes during AD conversion, the conversion halt immediately. After the halt mode is released, AD conversion restarts from the beginning in repeat conversion mode (3. and 4.), it does not restart in single conversion mode (1. and 2.).
93CS44-180
2004-02-10
TMP93CS44/S45
Table 3.11.2 shows the relations between AD conversion modes and interrupt request. Table 3.11.2 Relation between AD Conversion Modes and Interrupt Request Mode
Fixed channel single conversion mode Channel scan single conversion mode
Interrupt Request Timing
After conversion After conversion After every conversion
ADMOD0
X X 0 1 1 0 0 0 0 1
Fixed channel repeat conversion mode
After every fourth conversion After every scan conversion
Channel scan repeat conversion mode
X
1
1
X: Don't Care (5) AD conversion time 140 states (14 s at fc = 20 MHz) are required for AD conversion of one channel. (6) Storing and reading the AD conversion result AD conversion results are stored in AD conversion result registers high/low (ADREG04H/L to ADREG37H/L). These registers are read only. In fixed channel repeat conversion mode, AD conversion results are stored in order from ADREG04H/L to ADREG37H/L. Except in this mode, AD conversion results for channel AN0 and AN4, AN1 and AN5, AN2 and AN6, AN3 and AN7 are stored severally ADREG04H/L, ADREG15H/L, ADREG26H/L, ADREG37H/L. Table 3.11.3 shows correspondence between analog input channels and AD conversion result registers. Table 3.11.3 Correspondence between Analog Input Channels and AD Conversion Result Registers Analog Input Channel (port 5)
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7
AD Conversion Result Registers Fixed Channel Repeat Conversion Modes Conversion Mode except Right (Every fourth conversion)
ADREG04H/L ADREG15H/L ADREG26H/L ADREG37H/L ADREG04H/L ADREG15H/L ADREG26H/L ADREG37H/L ADREG37H/L ADREG04H/L ADREG15H/L ADREG26H/L
AD conversion result registers bit0 is AD conversion result stored flag . The flag shows that whether those registers are read or not. When AD conversion results are stored in those registers (ADREGxH or ADREGxL), this flag is set to 1. When each register is read, this flag is cleared to 0, and AD conversion end flag ADMOD0 is also cleared to 0.
93CS44-181
2004-02-10
TMP93CS44/S45
Setting example: 1. This example converts the analog input voltage at the AN3 pin. The INTAD interrupt routine writes the result to memory address 0800H.
Main routine setting: 76 INTE0AD ADMOD1 ADMOD0
5
4
3
210 -- 01 00 - 1 1 Enables INTAD and sets level 4. Sets analog input channel to AN3. Starts AD conversion in fixed channel single conversion mode.
1 1 0 0 - 1 X X X 0 X X 0 0 0
Example of interrupt routine processing: WA WA (0800H) ADREG37 >>6 WA Reads ADREG37L and ADREG37H values and writes them to WA (16 bits). Shifts right WA six times and zero fills the upper bits. Writes contents of WA to memory address 0800H.
2.
This example repeatedly converts the analog input voltages at pins AN0 to AN2, using channel scan repeat conversion mode.
1 0 0 0 - 1 X X X 0 X X 0 0 0 -- 01 11 - 0 1 Disables INTAD. Sets AN0 to AN2 as analog input channels. Starts AD conversion in channel scan repeat conversion mode.
INTE0AD ADMOD1 ADMOD0
X: Don't care, -: No change
93CS44-182
2004-02-10
TMP93CS44/S45
3.12 Watchdog Timer (Runaway detecting timer)
TMP93CS44/S45 contain a watchdog timer of runaway detecting. The watchdog timer (WDT) is used to return the CPU to the normal state when it detects that the CPU has started to malfunction (Runaway) due to causes such as noise. When the watchdog timer detects a malfunction, it generates a non-maskable interrupt INTWD to notify the CPU of the malfunction. Connecting the watchdog timer output to the reset pin internally forces a reset. This watchdog timer consists of 7-stage and 15-stage binary counters. These binary counters are also used as a warm-up timer for the internal oscillator stabilization. This is used for releasing the stop and before changing system clock.
3.12.1
Configuration
Figure 3.12.1 shows the block diagram of the watchdog timer (WDT).
RESET
Internal reset
WDMOD
WDTI interrupt SYSCR0
Interrupt control
Enable QS R
Reset WDMOD Write disable code to WDCR (B1H)
WDMOD T45CR Selector Selector
Selector 27
Selector 29 211 213 215
WDMOD SYSCR0
Selector
7-stage binary counter
15-stage binary counter Reset Reset HALT instruction (STOP, IDLE1 mode) Write clear code to WDCR (4EH)
/2
WDT/warm-up changing
fc/fs changing of warm-up clock CPU XT1 fs Selector /2
Selector
SYSCR1
fc
fc/2
fc/4
fc/8 fc/16
X1
/2 /4 /8 /16
SYSCR1
Figure 3.12.1 Block Diagram of Watchdog Timer/Warm-up Timer
93CS44-183
2004-02-10
TMP93CS44/S45
The watchdog timer consists of 7-stage and 15-stage binary counters which use system clock (fSYS) as the input clock. The 15-stage binary counter has fSYS/215, fSYS/217, fSYS/219 and fSYS/221 output. Selecting one of the outputs with the WDMOD register generates a watchdog timer interrupt and outputs watchdog timer out when an overflow occurs. The binary counter for the watchdog timer should be cleared to 0 with runaway detecting result software (Instruction) before an interrupt occurs. Example:
LDW LD SET (WDMOD), B100H (WDCR), 4EH 7, (WDMOD) ; Disable. ; Write clear code. ; Enable again.
The runaway detecting result can also be connected to the reset pin internally. In this case, the watchdog timer resets itself.
WDT counter WDT interrupt WDT clear (Software) Clear code of write n Overflow n 0
Figure 3.12.2 Normal Mode
Overflow WDT counter WDT interrupt Internal reset 8 to 20 states (12.8 to 32 s at 20 MHz) n
Figure 3.12.3 Reset Mode For warm-up counter, 27 and 29 output of 15-stage binary counter can be selected using WDMOD register. When a stable-external oscillator is used, shorter warm-up time is available using T45CR register. When = 1, counting value 27 is selected. When the watchdog timer is in operation, this shorter warm-up time function cannot be available. This function can be available by setting = 0.
93CS44-184
2004-02-10
TMP93CS44/S45 3.12.2 Control Registers
Watchdog timer (WDT) is controlled by two control registers WDMOD and WDCR. (1) Watchdog timer mode register (WDMOD) 1. Setting the detecting time of watchdog timer This 2-bit register is used to set the watchdog timer interrupt time for detecting the runaway. This register is initialized to WDMOD = 00 when reset. The defecting time of WDT is shown Table 3.12.1. 2. Watchdog timer enable/disable control register When reset, WDMOD is initialized to 1 enable the watchdog timer. To disable, it is necessary to set this bit to 0 and write the disable code (B1H) in the watchdog timer control register WDCR. This makes it difficult for the watchdog timer to be disabled by runaway. However, it is possible to return from the disable state to enable state by merely setting to 1. 3. Watchdog timer out reset connection This register is used to connect the output of the watchdog timer with RESET terminal, internally. Since WDMOD is initialized to 0 at reset, a reset by the watchdog timer will not be performed. (2) Watchdog timer control register (WDCR) This register is used to disable and clear of binary counter the watchdog timer function. * Disable control By writting the disable code (B1H) in this WDCR register after clearing WDMOD to 0, the watchdog timer can be disabled.
WDMOD WDCR 0 1 - 0 -- 11 - 0 - 0 XX 01 Clear WDMOD to "0". Write the disable code (B1H).
X: Don't care, -: No change
* *
Enable control Set WDMOD to 1. Watchdog timer clear control The binary counter can be cleared and resume counting by writing clear code (4EH) into the WDCR register.
WDCR
0
1
00
1
1
1
0
Write the clear code (4EH).
93CS44-185
2004-02-10
TMP93CS44/S45
Watchdog Timer Mode Control Register 7
WDMOD (005CH) Bit symbol Read/Write After reset Function
WDT control 0: Disable 1: Enable
6
WDTP1 0
00: 2 /fSYS 01: 217/fSYS 10: 219/fSYS 11: 221/fSYS
15
5
WDTP0 0
4
WARM 0
Warm-up time
3
HALTM1 R/W 0
Standby mode 00: RUN mode 01: STOP mode 10: IDLE1 mode
2
HALTM0 0
1
RESCR 0
1: Internally connects WDT out to the reset pin
0
DRVE 0
1: Drive the pin even in STOP mode
WDTE 1
Select detecting time
11: IDEL2 mode care (See Table 3.12.1)
Please refer to the section 3.3 "Dual Clock, Standby Function". Watchdog timer enable/disable control 0 Disable 1 Enable Selection of warm-up time when changing clock WDMOD 0 (2 /oscillation frequency) 0 (216/oscillation frequency)
14
Watchdog timer out control 0 Don't care 1 Connects WDT out to a reset at fc = 20M Hz, fs = 32.768 kHz Changing to Slow (fc) 500 ms 2000 ms
Changing to Normal (fc) 0.8192 ms 3.2768 ms
Selection of warm-up time when returning from the stop mode at fc = 20M Hz, fs = 32.768 kHz Warm-up Time System Clock Gear Value T45CR = 0 T45CR = 1 Selection = 0 = 1 = X 1 (fs) XXX (Don't care) 000 (fc) 001 (fc/2) 0 (fc) 010 (fc/4) 011 (fc/8) 100 (fc/16) 0.500 s 0.8192 ms 1.638 ms 3.277 ms 6.554 ms 13.107 ms 2.000 s 3.277 ms 6.544 ms 13.107 ms 26.214 ms 52.429 ms 3.9 ms 6.4 s 12.8 s 25.6 s 51.2 s 102.4 s
Note: When the watchdog timer is in operation, T45CR is set to 0.
Figure 3.12.4 Watchdog Timer Related Register (1/2)
93CS44-186
2004-02-10
TMP93CS44/S45
Watchdog Timer Control Register 7
WDCR (005DH) Bit symbol Read/Write After reset Function B1H: WDT disable code 4EH: WDT clear code
6
5
4
- W -
3
2
1
0
Disable/clear WDT B1H Disable code 4EH Others Note: When the watchdog timer is in operation, T45CR is set to 0. Clear code Don't care
Figure 3.12.5 Watchdog Timer Related Register (2/2) Table 3.12.1 Watchdog Timer Detecting Time
at fc = 20M Hz, fs = 32.768 kHz
System Clock Gear Value Selection
1 (fs) XXX (Don't care) 000 (fc) 001 (fc/2) 0 (fc) 010 (fc/4) 011 (fc/8) 100 (fc/16)
00
2.000 s 3.277 ms 6.554 ms 13.107 ms 26.214 ms 52.429 ms
Watchdog Timer Detecting Time WDMOD 01 10
8.000 s 13.107 ms 26.214 ms 53.429 ms 104.858 ms 209.715 ms 32.000 s 52.429 ms 104.858 ms 209.715 ms 419.430 ms 838.861 ms
11
128.000 s 209.715 ms 419.430 ms 838.861 ms 1.678 s 3.355 s
93CS44-187
2004-02-10
TMP93CS44/S45 3.12.3 Operation
The watchdog timer generates interrupt INTWD after the detecting time set in the WDMOD. The watchdog timer must be zero cleared by software before an INTWD interrupt is generated. If the CPU malfunctions (Runaway) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter overflows and an INTWD interrupt is generated. The CPU detects malfunction (Runaway) due to the INTWD interrupt and it is possible to return to normal operation by an anti-malfunction program. By connecting the watchdog timer out pin to peripheral devices' resets, a CPU malfunction can also be acknowledged to other devices. The watchdog timer restarts operation immediately after resetting is released. The watchdog timer stops its operation in the IDLE1 and STOP modes. In the RUN mode, the watchdog timer is enabled. However, the function can be disabled when entering the RUN, IDLE2 mode. Example: 1. Clear the binary counter
WDCR 0 1 0 0 11 1 0 Write clear code (4EH).
2. Set the watchdog timer detecting time to 217/fSYS
WDMOD 1 0 1 - -- XX
3. Disable the watchdog timer
WDMOD WDCR 0 1 -- 01 - 1 -- 00 XX 01 Clear WDTE to 0. Write disable code (B1H).
4. Set IDLE1 mode
WDMOD WDCR 0 1 - 0 - 1 - 1 10 00 XX 0 1 Disables WDT and sets IDLE1 mode. Set the HALT mode.
Executes halt command
5. Set the STOP mode (Warm-up time: 216/fSYS)
WDMOD - - - Executes halt command X: Don't care, -: No change 1 01 XX Set the STOP mode. Execute HALT instruction. Set the HALT mode.
93CS44-188
2004-02-10
TMP93CS44/S45
4. 4.1
Electrical Characteristics Maximum Ratings (TMP93CS44F, TMP93CS45F)
Parameter
Power supply voltage Input voltage Output current (Per 1 pin) P7 Output current (Per 1 pin) except P7 Output current (P7 total) Output current (Total) Output current (Total) Power dissipation (Ta = 85 C) Soldering temperature (10 s) Storage temperature Operating temperature
"X" used in an expression shows a cycle of clock fFPH selected by SYSCR1. If a clock gear or a low speed oscillator is selected, a value of "X" is different. The value as an example is calculated at fc, gear = 1/fc (SYSCR1 = 0000).
Symbol
VCC VIN IOL1 IOL2 IOL1 IOL IOH PD TSOLDER TSTG TOPR
Rating
-0.5 to 6.5 -0.5 to VCC + 0.5 20 2 80 120 -80 350 260 -65 to 150 -40 to 85
Unit
V V mA mA mA mA mA mW C C C
Note:
The maximum ratings are rated values which must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any maximum rating is exceeded, a device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products which include this device, ensure that no maximum rating value will ever be exceeded.
4.2
DC Characteristics (1/2)
Ta = -40 to 85C Parameter Symbol
VCC VIL VIL1 VIL2 VIL3 VIL4 VIH VIH1 VIH2 VIH3 VIH4 VOL IOL7 VOH1 IOL = 1.6 mA (VCC = 2.7 to 5.5 V) VOL = 1.0 V (VCC = 5 V 10%) (VCC = 3 V 10%) 16 7 2.4 4.2 VCC = 2.7 to 5.5 V VCC 4.5 V VCC < 4.5 V 2.2 2.0 0.7 VCC 0.75 VCC VCC - 0.3 0.8 VCC 0.45 V mA V V VCC + 0.3 VCC = 2.7 to 5.5 V
Condition
fc = 4 to 20 MHz fc = 4 to 12.5 MHz VCC 4.5 V VCC < 4.5 V fs = 30 to 34 kHz
Min
4.5 2.7
Typ. (Note)
Max
5.5 0.8 0.6
Unit
V
Power supply voltage Input low voltage AD0 to AD15
Port 2 to port 7 (except P35)
-0.3
0.3 VCC 0.25 VCC 0.3 0.2 VCC V
RESET , NMI , INT0 EA , AM8/ AM16
X1 Input high voltage AD0 to AD 15
Port 2 to port 7 (except P35) RESET , NMI , INT0
EA , AM8/ AM16
X1 Output low voltage Output low current (P7)
Output high voltage VOH2
IOH = -400 A (VCC = 3 V 10%) IOH = -400 A (VCC = 5 V 10%)
Note: Typical values are for Ta = 25C and VCC = 5 V unless otherwise noted.
93CS44-189
2004-02-10
TMP93CS44/S45
DC Characteristics (2/2)
Parameter
Darlington drive current (8 output pins max) Input leakage current Output leakage current Power down voltage (at stop, RAM back up)
Symbol
IDAR (Note 2) ILI ILO VSTOP
Condition
VEXT = 1.5 REXT = 1.1 k (VCC = 5 V 10% only) 0.0 VIN VCC 0.2 VIN VCC - 0.2 VIL2 = 0.2VCC, VIH2 = 0.8VCC VCC = 5.5 V VCC = 4.5 V VCC = 3.3 V VCC = 2.7 V fc = 1 MHz
Min
-1.0
Typ. (Note 1)
Max
-3.5
Unit
mA A V
0.02 0.05 2.0 45 50 70 90
5 10 6.0 130 160 280 400 10
RESET pull-up resistor
RRST
k
Pin capacitance Schmitt width RESET , NMI , INT0 Programmable pull-up resistor NORMAL (Note 3) RUN IDLE2 IDLE1 NORMAL (Note 3) RUN IDLE2 IDLE1 SLOW (Note 3) RUN IDLE2 IDLE1
CIO VTH
pF V
0.4 VCC = 5.5 V 45 50 70 90
1.0 130 160 280 400 19 25 25 17 5 10 9 6.5 1.5 45 40 25 15 10 0.2 20 50 17 12 3.5 6.5 5.0 4.5 0.8 20 16 15 5
RKH
VCC = 4.5 V VCC = 3.3 V VCC = 2.7 V VCC = 5 V 10% fc = 20 MHz
k
mA
VCC = 3 V 10% fc = 12.5 MHz (Typ. VCC = 3.0 V) ICC VCC = 3 V 10% fs = 32.768 kHz (Typ. VCC = 3.0 V) Ta 50C VCC = 2.7 V to 5.5 V
A
STOP
Ta 70C Ta 85C
A
Note 1: Note 2: Note 3:
Typical values are for Ta = 25C and VCC = 5 V unless otherwise noted. IDAR is guranteed for total of up to 8 ports. ICC measurement conditions (NORMAL, SLOW). Only CPU is operational; output pins are open and input pins are fixed.
(Reference) Definition of IDAR REXT IDAR VEXT
93CS44-190
2004-02-10
TMP93CS44/S45
4.3
AC Characteristics
(1) VCC = 5 V 10% Variable Min Max
50 2X - 40 0.5X - 20 1.5X - 70 0.5X - 15 0.5X - 20 X - 40 0.5X - 25 0.5X - 20 X - 25 1.5X - 50 0.5X - 25 3.0X - 55 3.5X - 65 2.0X - 60 2.0X - 40 0 X - 15 2.0X - 40 2.0X - 55 0.5X - 15 3.5X - 90 3.0X - 80 2.0X + 0 2.5X - 120 2.5X + 50 200 206 200 125 36 175 200 85 0 48 85 70 16 129 108 100 5 31250
No.
Parameter
Symbol
tOSC tCLK tAK tKA tAL tLA tLL tLC tCL tACL tACH tCA tADL tADH tRD tRR tHR tRAE tWW tDW tWD
(1 + N) WAIT mode (1 + N) WAIT mode (1 + N) WAIT mode
16 MHz Min Max
62.5 85 11 24 16 11 23 6 11 38 44 6 133 154 65
20 MHz Unit Min Max
50 60 5 5 10 5 10 0 5 25 25 0 95 110 40 60 0 35 60 45 10 85 70 ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
1 Oscillation period (= X) 2 CLK pulse width 3 A0 to A23 valid CLK hold 4 CLK valid A0 to A23 hold 5 A0 to A15 valid ALE fall 6 ALE fall A0 to A15 hold 7 ALE high pulse width 8 ALE fall RD / WR fall 9 RD / WR rise ALE rise 10 A0 to A15 valid RD / WR fall 11 A0 to A23 valid RD / WR fall 12 RD / WR rise A0 to A23 hold 13 A0 to A15 valid D0 to D15 input 14 A0 to A23 valid D0 to D15 input 15 RD fall D0 to D15 input 16 RD low pulse width 17 RD rise D0 to D15 hold 18 RD rise A0 to A15 output 19 21
WR low pulse width WR rise D0 to D15 hold
20 D0 to D15 valid WR rise 22 A0 to A23 valid WAIT input 23 A0 to A15 valid WAIT input 24
RD / WR fall WAIT hold
tAWH tAWL tCW tAPH tAPH2 tCP
25 A0 to A23 valid Port input 26 A0 to A23 valid Port hold 27
WR rise Port valid
AC measuring conditions * Output level: High 2.2 V, low 0.8 V, CL = 50 pF (However CL = 100 pF for AD0 to AD15, A0 to A23, ALE, RD , WR , HWR , CLK) * Input level: High 2.4 V, low 0.45 V (AD0 to AD15) High 0.8 x VCC, low 0.2 x VCC (except for AD0 to AD15)
93CS44-191
2004-02-10
TMP93CS44/S45
(2) VCC = 3 V 10% No. Parameter Symbol
tOSC tCLK tAK tKA tAL tLA tLL tLC tCL tACL tACH tCA tADL tADH tRD tRR tHR tRAE tWW tDW
(1 + N) WAIT mode (1 + N) WAIT mode (1 + N) WAIT mode
Variable Min Max
80 2X - 40 0.5X - 30 1.5X - 80 0.5X - 35 0.5X - 35 X - 60 0.5X - 35 0.5X - 40 X - 50 1.5X - 50 0.5X - 40 3.0X - 110 3.5X - 125 2.0X - 115 2.0X - 40 0 X - 25 2.0X - 40 2.0X - 120 0.5X - 40 3.5X - 130 3.0X - 100 2.0X + 0 2.5X - 195 2.5X + 50 200 31250
12.5 MHz Unit Min Max
80 120 10 40 5 5 20 5 0 30 70 0 130 155 45 120 0 55 120 40 0 150 140 160 5 250 200 ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
1 Oscillation period (= X) 2 CLK pulse width 3 A0 to A23 valid CLK hold 4 CLK valid A0 to A23 hold 5 A0 to A15 valid ALE fall 6 ALE fall A0 to A15 hold 7 ALE high pulse width 8 ALE fall RD / WR fall 9 RD / WR rise ALE rise 10 A0 to A15 valid RD / WR fall 11 A0 to A23 valid RD / WR fall 12 RD / WR rise A0 to A23 hold 13 A0 to A15 valid D0 to D15 input 14 A0 to A23 valid D0 to D15 input 15 RD fall D0 to D15 input 16 RD low pulse width 17 RD rise D0 to D15 hold 18 RD rise A0 to A15 output 19 21
WR low pulse width WR rise D0 to D15 hold
20 D0 to D15 valid WR rise 22 A0 to A23 valid WAIT input 23 A0 to A15 valid WAIT input 24
RD / WR fall WAIT hold
tWD tAWH tAWL tCW tAPH tAPH2 tCP
25 A0 to A23 valid Port input 26 A0 to A23 valid Port hold 27
WR rise Port valid
AC measuring conditions * Output level: High 0.7 x VCC, low 0.3 x VCC, CL = 50 pF * Input level: High 0.9 x VCC, low 0.1 x VCC
93CS44-192
2004-02-10
TMP93CS44/S45
(3) Read cycle
tOSC X1/XT1
tCLK CLK
tAK A0 to A23 tAWH tAWL
WAIT
tKA
tCW
tAPH tAPH2 Port input (Note) tADH tRR
RD
tCA
tACH tACL AD0 to AD15 tAL ALE tLL tLC
tRD tADL tHR D0 to D15 tCL tRAE
A0 to A15 tLA
Note:
Since the CPU accesses the internal area to read data from a port, the control signals of external pins such as RD and CS are not enabled. Therefore, the above waveform diagram should be regarded as depicting internal operation. Please also note that the timing and AC characteristics of port input/output shown above are typical representation. For details, contact your local Toshiba sales representative.
93CS44-193
2004-02-10
TMP93CS44/S45
(4) Write cycle
X1/XT1
CLK
A0 to A23
WAIT
Port output (Note)
WR , HWR
tWW tDW
tCP tWD
AD0 to AD15
A0 to A15
D0 to D15
ALE
Note:
Since the CPU accesses the internal area to write data to a port, the control signals of external pins such as WR and CS are not enabled. Therefore, the above waveform diagram should be regarded as depicting internal operation. Please also note that the timing and AC characteristics of port input/output shown above are typical representation. For details, contact your local Toshiba sales representative.
93CS44-194
2004-02-10
TMP93CS44/S45
4.4
Serial Channel Timing
(1) I/O interface mode 1.
Parameter
SCLK input mode
(Note 1)
Symbol Min
tSCY tOSS tOHS tHSR tSRD 16X
Variable Max
32.768 MHz Min Max
488 s 91.5 s 152 s 0
12.5 MHz Min
1.28 s 190 300 0
20 MHz Min
0.8 s 100 150 0
Unit
ns ns ns ns
Max
Max
SCLK cycke Output data Falling edge of SCLK SCLK rising/falling edge Output data hold SCLK rising/falling edge Input data hold (Note 2) SCLK rising/falling edge Effective data input (Note 2)
tSCY/2 - 5X - 50 5X - 100 0 tSCY - 5X - 100
336 s
780
450
ns
Note 1: When fs is used as system clock or fs divided by 4 is used as input clock to prescaler. Note 2: SCLK rising/falling timing; SCLK rising in the rising mode of SCLK, SCLK falling in the falling mode of SCLK. 2.
Parameter
SCLK cycle (Programmable) Output data SCLK rising edge SCLK rising edge Output data hold SCLK rising edge Input data hold SCLK rising edge Effective data input
SCLK output mode
(Note)
Symbol Min
tSCY tOSS tOHS tHSR tSRD 16X
Variable Max
8192X
32.768 MHz Min Max
12.5 MHz Min Max
20 MHz Min Max
Unit
488 s 250 ms 1.28 s 655.36 s 0.8 s 409.6 s ns 427 s 60 s 0 970 80 0 428 s 970 550 20 0 550 ns ns ns ns
tSCY - 2X - 150 2X - 80 0 tSCY - 2X - 150
Note: When fs is used as system clock or fs divided by 4 is used as input clock to prescaler.
SCLK Output mode/ input rising edge mode SCLK (Input falling edge mode) Output data TXD Input data RXD tSCY
tOSS 0
tOHS 1 tSRD 0 Valid 1 Valid tHSR 2 Valid 3 Valid 2 3
(2) UART mode (SCLK0 and SCLK1 are external input)
(Note)
Parameter
SCLK cycle SCLK low level pulse width SCLK high level pulse width
Symbol Min
tSCY tSCYL tSCYH
Variable Max
4X + 20 2X + 5 2X + 5
32.768 MHz Min Max
122 s 6 s 6 s
12.5 MHz Min
340 165 165
20 MHz Min
220 105 105
Unit
ns ns ns
Max
Max
Note: When fs is used as system clock or fs divided by 4 is used as input clock to prescaler.
93CS44-195
2004-02-10
TMP93CS44/S45
4.5
AD Conversion Characteristics
AVCC = VCC, AVSS = VSS Parameter Symbol
VREFH VREFL VAIN VCC = 5 V 10% VCC = 3 V 10% VCC = 2.7 to 5.5 V VCC = 5 V 10% VCC = 3 V 10%
10
Power Supply
VCC = 5 V 10% VCC = 3 V 10% VCC = 5 V 10% VCC = 3 V 10%
Min
VCC - 0.2 V VCC - 0.2 V VSS VSS VREFL
Typ.
VCC VCC VSS VSS 0.5 0.3 0.02 1.0 1.0
Max
VCC VCC VSS + 0.2 V VSS + 0.2 V VREFH 1.5 0.9 5.0 3.0 5.0
Unit
Analog reference voltage ( + ) Analog reference voltage ( - ) Analog input voltage range
V
Analog current for analog reference IREF voltage (VREFL = = 1 0 V) = 0 Error (except quantization errors) -
mA A LSB
Note 1: 1LSB = (VREFH - VREFL)/2 [V] Note 2: The operation above is guaranteed for fFPH 4 MHz. Note 3: The value ICC includes the current which flows through the AVCC pin.
4.6
Event Counter Input Clock (External input clock: TI0, TI4, TI5, TI6, TI7)
Parameter Symbol
tVCK tVCKL tVCKH
Variable Min Max
8X + 100 4X + 40 4X + 40
12.5 MHz Min Max
740 360 360
20 MHz Min Max
500 240 240
Unit
ns ns ns
Clock cycle Low level clock pulse width High level clock pulse width
4.7
Interrupt and Capture Operation
(1) NMI and INT0 interrupts Parameter Symbol
tINTAL tINTAH
Variable Min Max
4X 4X
12.5 MHz Min Max
320 320
20 MHz Min Max
200 200
Unit
ns ns
NMI , INT0 low level pulse width
NMI , INT0 high level pulse width
(2) INT1, INT4 to INT7 interrupts and capture Parameter
INT1, INT4 to INT7 low level pulse width INT1, INT4 to INT7 high level pulse width
Symbol
tINTBL tINTBH
Variable Min Max
4X + 100 4X + 100
12.5 MHz Min Max
420 420
20 MHz Min Max
300 300
Unit
ns ns
93CS44-196
2004-02-10
TMP93CS44/S45
4.8
Serial Bus Interface Timing
(1) I2C bus mode Parameter Symbol
tGSTA tHD:STA tLOW tHIGH tHD:IDAT tSU:IDAT tHD:ODAT tODAT tFSDA tFDRC tSU:STO 3X 2nX 2nX + 16X
Min
3X 2nX 2nX 2nX + 12X 0 250 7X
Variable Typ.
Max
Unit
ns ns ns ns ns ns
START command SDA fall Hold time START condition SCL low level pulse width SCL high level pulse width Data hold time (Input) Data setup time (Input) Data hold time (Output) Data output SCL rising edge STOP command SDA fall SDA falling edge SCL rising edge Setup time STOP condition
11X 2nX - tHD:ODAT
ns ns ns ns ns
Note: "n" value is set by SBICR1.
START command SDA tGSTA tLOW SCL tHD:STA tHD:IDAT tHIGH tSU:IDAT tSU:STO tHD:ODAT tODAT tFSDA tFDRC STOP command
93CS44-197
2004-02-10
TMP93CS44/S45
(2) Clock synchronous 8-bit SIO mode 1. SCK input mode Parameter
SCK cycle SCK falling edge Output data hold Output data SCK rising edge SCK rising edge Input data hold Input data SCK rising edge
Symbol
tSCY2 tOHS2 tOSS2 tHSR2 tISS2
Variable Min
25X 6X tSCY2 - 6X 6X 0
Max
Unit
ns ns ns ns ns
2.
SCK output mode Parameter Symbol
tSCY2 tOHS2 tOSS2 tHSR2 tISS2
Variable Min
25X 2X tSCY2 - 2X 2X 0 tOSS2 tISS2
Max
211X
Unit
ns ns ns ns ns
SCK cycle SCK falling edge Output data hold Output data SCK rising edge SCK rising edge Input data hold Input data SCK rising edge
tSCY2 SCK (Input/output mode) SO (Output data) SI (Input data) tHSR2 tOHS2
93CS44-198
2004-02-10
TMP93CS44/S45
5.
Table of Special Function Registers
The special function registers (SFRs) include the I/O ports and peripheral control registers allocated to the 128-byte addresses from 000000H to 00007FH. (1) I/O port (2) I/O port control (3) Clock control (4) Interrupt control (5) Bus width/wait control (6) Timer control (7) Serial channel control (8) Serial bus interface control (9) Watchdog timer control (10) AD converter control Configuration of the table Symbol Name Address 7 6 1 0
Bit symbol Read/Write Initial value after reset Remarks
Note:
"Prohibit RMW" in the table means that you cannot use RMW instructions on these registers. When setting only bit0 of register P0CR, "SET 0, (0002H)" cannot be used. The LD (Transfer) instruction must be used to write all 8 bits.
(Example)
93CS44-199
2004-02-10
TMP93CS44/S45
Table 5.1 I/O Register Address Map
Address 000000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH Name P0 P1 P0CR (Reserved) P1CR P1FC P2 P3 P2CR P2FC P3CR P3FC P4 P5 P4CR (Reserved) P4FC (Reserved) P6 P7 P6CR P7CR P6FC Address 20H 21H 22H 23H 24H 25H 26H 27H 28H 29H 2AH 2BH 2CH 2DH 2EH 2FH 30H 31H 32H 33H 34H 35H 36H 37H 38H 39H 3AH 3BH 3CH 3DH 3EH 3FH Name TRUN (Reserved) TREG0 TREG1 T10MOD TFFCR TREG2 TREG3 T32MOD TRDC Address 40H 41H 42H 43H 44H 45H 46H 47H 48H 49H 4AH 4BH 4CH 4DH 4EH 4FH 50H 51H 52H 53H 54H 55H 56H 57H 58H 59H 5AH 5BH 5CH 5DH 5EH 5FH Name TREG6L TREG6H TREG7L TREG7H CAP3L CAP3H CAP4L CAP4H T5MOD T5FFCR (Reserved) SBICR1 SBIDBR I2CAR SBICR2 SBICR3 SC0BUF SC0CR SC0MOD BR0CR SC1BUF SC1CR SC1MOD BR1CR ODE (Reserved) WDMOD WDCR ADMOD0 ADMOD1 Address 60H 61H 62H 63H 64H 65H 66H 67H 68H 69H 6AH 6BH 6CH 6DH 6EH 6FH 70H 71H 72H 73H 74H 75H 76H 77H 78H 79H 7AH 7BH 7CH 7DH 7EH 7FH Name ADREG04L ADREG04H ADREG15L ADREG15H ADREG26L ADREG26H ADREG37L ADREG37H WAITC0 WAITC1 WAITC2 (Reserved) (Reserved) CKOCR SYSCR0 SYSCR1 INTE0AD INTE45 INTE67 INTET10 INTET32 INTET54 INTET76 INTEO54 INTES0 INTES1 INTE1S2 IIMC DMA0V DMA1V DMA2V DMA3V
(Reserved)
TREG4L TREG4H TREG5L TREG5H CAP1L CAP1H CAP2L CAP2H T4MOD T4FFCR T45CR
(Reserved)
(Reserved)
Note:
Do not access addresses which do not have register names allocated.
93CS44-200
2004-02-10
TMP93CS44/S45
(1) I/O port
Symbol Name Address 7
P07 P0 Port 0 00H
6
P06
5
P05
4
P04
3
P03
2
P02
1
P01
0
P00
P17 P1 Port 1 01H 0 P27 1
P16 0 P26 1
P15 0 P25 1 P35 1
P2
Port 2
06H (Prohibit RMW*) 07H (Prohibit RMW*)
R/W Undefined Input mode P14 P13 R/W 0 0 Input mode P24 P23 R/W 1 1 Input mode P34 P33 R/W
P12 0 P22 1 P32
P11 0 P21 1 P31
P10 0 P20 1 P30 (Note1)
P3
Port 3
P47 P4 Port 4 0CH 1 P57 P5 Port 5 0DH P67
P46 1 P56
P45 1 P55
P6
Port 6
12H (Prohibit RMW*)
P66
P65 1 P75 1
1 1 Output mode P77 P76 1 1
P7
Port 7
13H
1 1 1 Input mode P44 P43 P42 R/W 1 1 1 Input mode P54 P53 P52 R Input mode P64 P63 P62 R/W 1 1 1 Input mode P74 P73 P72 R/W 1 1 1 Input mode
1 1 Output mode P41 P40 1 P51 1 P50
P61 1 P71 1
P60 1 P70 1
Note 1: When P30 pin is defined as RD signal output mode (P30F = 1), clearing the output latch register P30 to 0 outputs the RD strobe from P30 pin for PSRAM, even when the internal address is accessed. If the output latch register P30 remains 1, the RD strobe is output only when the external address is accessed. Note 2: Port 66 and 67 are also used as XT1, XT2. Therefore these pins are open drain output type. Read/Write R/W: Either read or write is possible. R: Only read is possible. W: Only write is possible. Prohibit RMW: Prohibit read-modify-write. (Prohibit RES/SET/TSET/CHG/STCF/ANDCF/ORCF/XORCF instruction.) Prohibit RMW*: Read-modify-write is prohibited when controlling the PU resistor.
93CS44-201
2004-02-10
TMP93CS44/S45
(2) I/O port control
Symbol Name
Port 0 control register Port 1 control register Port 1 function register Port 2 control register Port 2 function register Port 3 control register
Address
02H (Prohibit RMW) 04H (Prohibit RMW) 05H (Prohibit RMW) 08H (Prohibit RMW) 09H (Prohibit RMW) 0AH (Prohibit RMW) 0BH (Prohibit RMW)
7
P07C 0
6
P06C
5
P05C
4
P04C
3
P03C
2
P02C
1
P01C
0
P00C
P0CR
P1CR
P1FC
P2CR
P2FC
P3CR
P3FC
Port 3 function register
P4CR
Port 4 control register
0EH (Prohibit RMW) 10H (Prohibit RMW)
P4FC
Port 4 function register
P6CR
Port 6 control register Port 7 control register
14H (Prohibit RMW) 15H (Prohibit RMW) 16H (Prohibit RMW)
P7CR
P6FC
Port 6 function register
W 0 0 0 0 0 0 0 0: Input 1: Output (when external access, set as AD7 to AD0 and cleared to "0".) P17C P16C P15C P14C P13C P12C P11C P10C W 0 0 0 0 0 0 0 0 <> P17F P16F P15F P14F P13F P12F P11F P10F W 0 0 0 0 0 0 0 0 P1FC/P1CR = 00: Input 01: Output 10: AD15 to AD8 11: A15 to A8 P27C P26C P25C P24C P23C P22C P21C P20C W 0 0 0 0 0 0 0 0 <> P27F P26F P25F P24F P23F P22F P21F P20F W 0 0 0 0 0 0 0 0 P2FC/P2CR = 00: Input 01: Output 10: A7 to A0 11: A23 to A16 P35C P34C P33C P32C W 0 0 0 0 0: Input 0: Output P32M P34F P33F P32F P31F P30F W W 0 0 0 0 0 0 0: Port 0: Port 0: Port 0: Port 0: Port 0: HWR 1: RD 1: SCK 1: SCL/SI 1: SDA/SO 1: P32M 1: WR P47C P46C P45C P44C P43C P42C P41C P40C W 0 0 0 0 0 0 0 0 0: Input 0: Output P47F P44F P41F W W W 0 0 0 0: Port 0: Port 0: Port 1: TO6 1: TO4 1: TO3 P67C P66C P65C P64C P63C P62C P61C P60C W 1 1 0 0 0 0 0 0 0: Input 0: Output P77C P76C P75C P74C P73C P72C P71C P70C W 0 0 0 0 0 0 0 0 0: Input 0: Output P65F P63F P62F P60F W W W 0 0 0 0 0: Port 0: Port 0: Port 0: Port 1: SCLK1 1: TXD1 1: SCLK0 1: TXD0
Note:
With the TMP93CS45, which requires an external ROM, port 0 functions as AD0 to AD7; port 1, AD8 to AD15 or A8 to A15; P30, the RD signal; P31, the WR signal, regardless of the values set in P0CR, P1CR, P1FC, P30F and P31F.
93CS44-202
2004-02-10
TMP93CS44/S45
(3) Clock control
Symbol Name Address 7
- R/W CKOCR Clock output control register 0 006DH
Always write "0".
6
- 0
5
4
3
2
1
0
ALEEN CLKEN R/W 0/1 0/1
ALE pin control 0: High-Z output 1: ALE output CLK pin control 0: High-Z output 1: CLK output
XEN 1 System clock control register 0
XTEN 0
RXEN 1
RXTEN RSYSCK R/W 0 0
WUEF 0
PRCK1 0
PRCK0 0
High-frequency Low-frequency High-frequency Low-frequency Select clock Warm-up oscillator (fc) oscillator (fs) oscillator (fc) oscillator (fs) after released timer 0: Stop 0: Stop 1: Oscillation
Select prescaler clock 00: fFPH 01: fs 10: fc/16 11: (Reserved)
SYSCR0
006EH
1: Oscillation
after released STOP mode 0: Stop 1: Oscillation
after released STOP mode 0: Stop 1: Oscillation
STOP mode 0: fc 1: fs
(Write) 0: Don't care 1: Start timer (Read) 0: End warm up 1: Not end warm up
SYSCK 0 System clock control register 1
GEAR2 GEAR1 R/W 1 0
GEAR0 0
Select system Select gear value of high frequency (fc) clock 000: fc
SYSCR1
006FH
0: fc 1: fs (Note 2)
001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved)
Note 1: The value after reset of , is following: TMP93CS44: 0 (High-impedance output) TMP93CS45: 1 (CLK or ALE output) But during reset, CLK pin is pulled up internally regardless of the products. Note 2: The high-frequency oscillator will be enabled regardless the value of SYSCR0 when SYSCR1 is clear to 0. On the other hand, the low-frequency oscillator will be enabled regardless the value of SYSCR0 when SYSCR1 is set to 1.
93CS44-203
2004-02-10
TMP93CS44/S45
(4) Interrupt control (1/2)
Symbol Name
INT0/AD enable register
Address
0070H (Prohibit RMW) 0071H (Prohibit RMW) 0072H (Prohibit RMW) 0073H (Prohibit RMW) 0074H (Prohibit RMW) 0075H (Prohibit RMW) 0076H (Prohibit RMW) 0077H (Prohibit RMW) 0078H (Prohibit RMW) 0079H (Prohibit RMW) 007AH (Prohibit RMW)
7
IADC R/W 0 I5C R/W 0 I7C R/W 0 IT1C R/W 0 IT3C R/W 0 IT5C R/W 0 IT7C R/W 0 ITO5C R/W 0 ITX0C R/W 0 ITX1C R/W 0 I1C R/W 0
6
5
4
IADM0 0 I5M0 0 I7M0 0 IT1M0 0 IT3M0 0 IT5M0 0 IT7M0 0 ITO5M0 0 ITX0M0 0 ITX1M0 0 I1M0 0
3
I0C R/W 0 I4C R/W 0 I6C R/W 0 IT0C R/W 0 IT2C R/W 0 IT4C R/W 0 IT6C R/W 0 ITO4C R/W 0 IRX0C R/W 0 IRX1C R/W 0 IS2C R/W 0
2
INT0 I0M2 0 INT4 I4M2 0 INT6 I6M2
1
I0M1 W 0 I4M1 W 0
0
I0M0 0 I4M0 0 I6M0 0 IT0M0 0 IT2M0 0 IT4M0 0 IT6M0 0 ITO4M0 0 IRX0M0 0 IRX1M0 0 IS2M0 0
INTE0AD
INTE45
INT4/5 enable register
INTE67
INT6/7 enable register
INTET10
INTT1/0 enable register
INTET32
INTT3/2 enable register
INTET54
INTT5/4 enable register INTT7/6 enable register INTTO 5/4 enable register INTRX0/ TX0 enable register INTRX1/ TX1 enable register INT1/ INTS2 enable register
INTET76
INTEO54
INTES0
INTES1
INTE1S2
INTAD IADM2 IADM1 W 0 0 INT5 I5M2 I5M1 W 0 0 INT7 I7M2 I7M1 W 0 0 INTT1 (Timer 1) IT1M2 IT1M1 W 0 0 INTT3 (Timer 3) IT3M2 IT3M1 W 0 0 INTTR5 (TREG5) IT5M2 IT5M1 W 0 0 INTTR7 (TREG7) IT7M2 IT7M1 W 0 0 INTTO5 ITO5M2 ITO5M1 W 0 0 INTTX0 ITX0M2 ITX0M1 W 0 0 INTTX1 ITX1M2 ITX1M1 W 0 0 INT1 I1M2 I1M1 W 0 0
I6M1 W 0 0 INTT0 (Timer 0) IT0M2 IT0M1 W 0 0 INTT2 (Timer 2) IT2M2 IT2M1 W 0 0 INTTR4 (TREG4) IT4M2 IT4M1 W 0 0 INTTR6 (TREG6) IT6M2 IT6M1 W 0 0 INTTO4 ITO4M2 ITO4M1 W 0 0 INTRX0 IRX0M2 IRX0M1 W 0 0 INTRX1 IRX1M2 IRX1M1 W 0 0 INTS2 IS2M2 IS2M1 W 0 0
IxxM2
0 0 0 0 1 1 1 1
IxxM1
0 0 1 1 0 0 1 1
IxxM0
0 1 0 1 0 1 0 1
Function (Write)
Prohibits interrupt request. Sets interrupt request level to 1. Sets interrupt request level to 2. Sets interrupt request level to 3. Sets interrupt request level to 4. Sets interrupt request level to 5. Sets interrupt request level to 6. Prohibits interrupt request.
IxxC
0 1
Function (Read)
Indicates no interrupt request. Indicates interrupt request.
Function (Write)
Clears interrupt request flag. - - - - - Don't care - - - - -
93CS44-204
2004-02-10
TMP93CS44/S45
Interrupt control (2/2)
Symbol Name
DMA 0 request vector
Address
7CH (Prohibit RMW) 7DH (Prohibit RMW) 7EH (Prohibit RMW) 7FH (Prohibit RMW)
7
6
5
4
DMA0V4
3
DMA0V3
2
1
0
DMA0V
0 DMA1V4
DMA1V
DMA 1 request vector
0 DMA2V4
DMA2V
DMA 2 request vector
0 DMA3V4
DMA3V
DMA 3 request vector
0 - W 0 Always write "0".
IIMC
Interrupt input mode control
7BH (Prohibit RMW)
DMA0V2 DMA0V1 DMA0V0 W 0 0 0 0 Micro DMA0 start vector DMA1V3 DMA1V2 DMA1V1 DMA1V0 W 0 0 0 0 Micro DMA1 start vector DMA2V3 DMA2V2 DMA2V1 DMA2V0 W 0 0 0 0 Micro DMA2 start vector DMA3V3 DMA3V2 DMA3V1 DMA3V0 W 0 0 0 0 Micro DMA3 start vector I0IE I0LE NMIREE W 0 0 0 1: INT0 0: INT0 1: Operainput edge tion enable mode even at 1: INT0 NMI level rising mode edge
(5) Bus width/wait control
Symbol Name Address 7 6 5 4
B0BUS Block 0 WAIT control register 68H (Prohibit RMW) 0 0: 16-bit bus 1: 8-bit bus B1BUS Block 1 WAIT control register 69H (Prohibit RMW) 0 0: 16-bit bus 1: 8-bit bus B2BUS 0 0: 16-bit bus 1: 8-bit bus
3
B0W1
2
B0W0 W 0
1
B0C1
0
B0C0
WAITC0
WAITC1
WAITC2
Block 2 WAIT control register
6AH (Prohibit RMW)
0 00: 2 waits 01: 1 wait 10: (1 + N) waits 11: 0 waits B1W1 B1W0 W 0 0 00: 2 waits 01: 1 wait 10: (1 + N) waits 11: 0 waits B2W1 B2W0 W 0 0 00: 2 waits 01: 1 wait 10: (1 + N) waits 11: 0 waits
0 0 00: 7F00H to 7FFFH 01: 400000H to 10: 800000H to 11: C00000H to B1C1 B1C0 0 0 00: 880H to 7FFFH 01: 400000H to 10: 800000H to 11: C00000H to B2C1 B2C0 1 1 8000H to 400000H to 800000H to C00000H to
00: 01: 10: 11:
93CS44-205
2004-02-10
TMP93CS44/S45
(6) Timer control (1/3)
Symbol Name Address 7
PRRUN R/W 0
6
5
T5RUN
4
T4RUN
3
2
1
0
TRUN
Timer control register
20H
TREG0
8-bit timer register 0 8-bit timer register 1 8-bit timer 0 and 1 source CLK and mode control register
22H (Prohibit RMW) 23H (Prohibit RMW) T10M1 R/W 24H 0 0 00: 8-bit timer 01: 16-bit timer 10: - 11: - TFF3C1 TFF3C0 W 1 1 00: Invert TFF3 01: Set TFF3 10: Clear TFF3 11: Don't care T10M0
TREG1
T10 MOD
TFFCR
8-bit timer flip-flop control register
25H
TREG2
8-bit timer register 2 8-bit timer register 3 8-bit timer 2 and 3 source CLK and mode control register
26H (Prohibit RMW) 27H (Prohibit RMW) T32M1 T32M0
TREG3
T32 MOD
28H
0 0 00: 8-bit timer 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM
TRDC
Timer register double buffer control register
29H
T3RUN T2RUN T1RUN T0RUN R/W 0 0 0 0 0 0 Prescaler and timer run/stop control 0: Stop and clear 1: Run (Count up) - W Undefined - W Undefined T1CLK1 T1CLK0 T0CLK1 T0CLK0 R/W 0 0 0 0 00: TO0TRG 00: TI0 INPUT 01: T1 01: T1 10: T16 10: T4 11: T256 11: T16 TFF3IE TFF3IS TFF1C1 TFF1C0 TFF1IE TFF1IS R/W W R/W 0 0 1 1 0 0 1: TFF3 TFF3 00: Invert TFF1 1: TFF1 TFF1 invert inversion invert inversion 01: Set TFF1 enable select enable select 10: Clear TFF1 0: Timer 2 11: Don't care 0: Timer 0 1: Timer 3 1: Timer 1 - W Undefined - W Undefined PWM21 PWM20 T3CLK1 T3CLK0 T2CLK1 T2CLK0 R/W 0 0 0 0 0 0 00: - 00: TO2TRG 00: - 01: 26 - 1 PWM 01: T1 01: T1 10: 27 - 1 cycle 10: T16 10: T4 11: 28 - 1 11: T256 11: T16 TR2DE - R/W 0 0 0: Double Always write "0". buffer disable 1: Double buffer enable
93CS44-206
2004-02-10
TMP93CS44/S45
Timer control (2/3)
Symbol
TREG4L
Name
16-bit timer register 4 low 16-bit timer register 4 high 16-bit timer register 5 low 16-bit timer register 5 high Capture register 1 low Capture register 1 high Capture register 2 low Capture register 2 high 16-bit timer 4 source CLK and mode control register
Address
30H (Prohibit RMW) 31H (Prohibit RMW) 32H (Prohibit RMW) 33H (Prohibit RMW) 34H
7
6
5
4
- W Undefined - W Undefined - W Undefined - W Undefined
3
2
1
0
TREG4H
TREG5L
TREG5H
CAP1L
CAP1H
35H
CAP2L
36H
CAP2H
37H CAP1IN W 1 0:Software capture 1: Don't care
T4MOD
38H
T4FFCR
16-bit timer 4 flip-flop control register
39H
0 0 Source clock 00: TI4 01: T1 10: T4 11: T16 TFF4C1 TFF4C0 W 1 1 00: Invert TFF4 01: Set TFF4 10: Clear TFF4 Invert when Invert when Invert when Invert when 11: Don't care
the UC value the UC value the UC is loaded to is loaded to matches CAP2 CAP1 TREG5 the UC matches TREG4
CLE R/W 0 0 0 Capture timing 1: UC4 clear 00: Disable enable 01: TI4 TI5 10: TI4 TI4 11: TTF1 TTF1 CAP2T4 CAP1T4 EQ5T4 EQ4T4 R/W 0 0 0 0 TFF4 invert trigger 0: Disable trigger 1: Enable trigger
- R Undefined - R Undefined - R Undefined - R Undefined CAP12M1 CAP12M0
T4CLK1
T4CLK0
93CS44-207
2004-02-10
TMP93CS44/S45
Timer control (3/3)
Symbol Name Address 7
QCU R/W 0 Warm-up timer control
6
5
4
3
2
1
0
T45CR
T4 and T5 control register
3AH
DB6EN DB4EN R/W 0 0 Double buffer 0: Disable 1: Enable Double Double buffer of buffer of TREG6 TREG4 - W Undefined - W Undefined - W Undefined - W Undefined - R Undefined - R Undefined - R Undefined - R Undefined CAP34M1 CAP34M0
TREG6L
TREG6H
TREG7L
TREG7H
16-bit timer register 6 low 16-bit timer register 6 high 16-bit timer register 7 low 16-bit timer register 7 high Capture register 3 low Capture register 3 high Capture register 4 low Capture register 4 high 16-bit timer 5 source CLK and mode control register
40H (Prohibit RMW) 41H (Prohibit RMW) 42H (Prohibit RMW) 43H (Prohibit RMW) 44H
CAP3L
CAP3H
45H
CAP4L
46H
CAP4H
47H CAP3IN W 1 0:Software capture 1: Don't care
T5MOD
48H
T5FFCR
16-bit timer 5 flip-flop control register
49H
0 0 Source clock 00: TI6 01: T1 10: T4 11: T16 TFF6C1 TFF6C0 W 1 1 00: Invert TFF6 01: Set TFF6 10: Clear TFF6 Invert when Invert when Invert when Invert when 11: Don't care
the UC value the UC value the UC is loaded to is loaded to matches CAP4 CAP3 TREG7 the UC matches TREG6
CLE R/W 0 0 0 Capture timing 1: UC5 clear 00: Disable enable 01: TI6 TI7 10: TI6 TI6 11: TTF1 TTF1 CAP4T6 CAP3T6 EQ7T6 EQ7T6 R/W 0 0 0 0 TFF6 invert trigger 0: Disable trigger 1: Enable trigger
T5CLK1
T5CLK0
93CS44-208
2004-02-10
TMP93CS44/S45
(7) Serial channel control
Symbol Name
Serial channel 0 buffer register
Address
50H (Prohibit RMW)
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
SC0BUF
SC0CR
Serial channel 0 control register
51H
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R (Receiving)/W (Transmission) Undefined RB8 EVEN PE OERR PERR FERR R R/W R (Cleared to "0" by reading.) Undefined 0 0 0 0 0 Receiving Parity 1: Error 1: Parity data bit8 0: Odd enable Overrun Parity Framing 1: Even TB8 CTSE0 0 1: CTS0 enable RXE WU R/W
Undefined
SCLKS R/W
IOC
0 0 0: SCLK0 1: Input SCLK0 pin 1: SCLK0 SC1 SC0
SM1
SM0
Serial channel 0 SC0MOD mode control register
52H
Transmission data bit8
BR0CR
Baud rate 0 control register
53H
- R/W 0 Fix at "0".
SC1BUF
Serial channel 1 buffer register
54H (Prohibit RMW)
RB7 TB7
RB6 TB6
RB8 R SC1CR Serial channel 1 control register 55H
EVEN
0 Undefined Receiving Parity data bit8 0: Odd 1: Even TB8 CTSE1
0 0 0 0 0 0 1: Receive 1: Wakeup 00: I/O interface 00: TO2 trigger enable enable 01: UART 7-bit 01: Baud rate generator 10: UART 8-bit 10: Internal clock 1 11: External clock SCLK0 11: UART 9-bit BR0CK1 BR0CK0 BR0S3 BR0S2 BR0S1 BR0S0 R/W 0 0 0 0 0 0 00: T0 Set frequency divisor 01: T2 0000: 16 divisions 10: T8 0001 11: T32 to 1 to 15 divisions 1111 RB5 RB4 RB3 RB2 RB1 RB0 TB5 TB4 TB3 TB2 TB1 TB0 R (Receiving)/W (Transmission) Undefined PE OERR PERR FERR SCLKS IOC R/W R (Cleared to "0" by reading.) R/W 0 0 0 0 0 0 1: Parity 0: SCLK1 1: Input 1: Error enable SCLK1 pin Overrun Parity Framing 1: SCLK1 RXE WU R/W SM1 SM0 SC1 0
00: TO2 trigger 01: Baud rate generator 10: Internal clock 1 11: External clock SCLK1
SC0 0
Serial channel 1 SC1MOD mode control register
Undefined
56H
Transmission data bit8
0 1: CTS1 enable
0 0 0 0 1: Receive 1: Wakeup 00: I/O interface enable enable 01: UART 7-bit 10: UART 8-bit 11: UART 9-bit BR1CK1 0 T0 T2 T8 T32 BR1CK0 0 BR1S3 R/W 00: 01: 10: 11: BR1S2
BR1CR
Baud rate 1 control register
57H
- R/W 0 Fix at "0".
BR1S1
BR1S0 0
ODE
Serial open-drain enable
58H
0 0 0 Set frequency divisor 0000: 16 divisions 0001 to 1 to 15 divisions 1111 ODE34 ODE33 ODE63 R/W 0 0 0 1: P34 1: P33 1: P63 open open open drain drain drain
ODE60 0 1: P60 open drain
93CS44-209
2004-02-10
TMP93CS44/S45
(8) Serial bus interface control (1/2)
Symbol Name Address 7
BC2 4BH (I2C bus mode) 0
000: 8 001: 1
6
BC1 W 0
100: 4 101: 5 110: 6 111: 7
5
BC0 0
4
ACK R/W 0
Acknowledge mode specification 0: Disable 1: Enable
3
2
SCK2 0
000: 4 001: 5 010: 6 011: 7
1
SCK1 W 0
100: 8 101: 9 110: 10
0
SCK0 0
Number of transfer bits
Setting of the divide value "n"
SBICR1
Serial bus interface control register 1
(Prohibit RMW)
010: 2 011: 3
111: (Reserved)
SIOS 4BH (SIO mode) 0 Indicate transfer start/stop 0: Stop 1: Start MST 4EH (I C bus mode)
2
SIOINH W 0
Continue/ abort transfer 0: Continue 1: Abort
SIOM1 0
SIOM0 0
SCK2 0
000: fFPH/25 001: fFPH/2
6
SCK1 W 0
100: fFPH/29 101: fFPH/2 110: PH/211
10
SCK0 0
Transfer mode select 00: 8-bit transmit 01: (Reserved) 10: 8-bit transmit/receive 11: 8-bit receive
Serial clock selection
(Prohibit RMW)
010: fFPH/27 011: fFPH/2
8
111: External clock (SCK pin)
TRX 0
BB W 0
PIN 1 Cancel INTS2 request 0: Don't care 1: Cancel
SBIM1 0
SBIM0 0
SBICR2
Serial bus interface control register 2
(Prohibit RMW)
0 Master/ slave selection 0: Slave 1: Master
Transmitter/ Start/stop generation receiver selection (when the 0: Receiver MST, TRX,
1: Transmitter PIN are "1") 0: Stop 1: Start
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
SBIM1 4EH (SIO mode) W 0
SBIM0 0
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 10: I C bus mode 11: (Reserved)
2
(Prohibit RMW) MST 4EH (I2C bus mode) 0
Master/ slave selection status monitor 0: Slave 1: Master
TRX 0
BB R
PIN 1 INTS2 request status monitor 0: Request 1: Cancel
AL 0 Noise detection monitor 1: detect
AAS 0 Slave address much detection monitor 1: Detect SEF R 0 Shift operating status monitor 0: Terminated 1: In process
AD0 0 GENERAL CALL detection monitor 1: Detect
LRB 0 Last received bit monitor 0: "0" 1: "1"
(Prohibit RMW) Serial bus interface status register
0 I2C bus status monitor 0: Bus free 1: Bus 0: Receiver busy
Transmitter/ receiver selection status monitor
1: Transmitter
SBISR
SIOF 4EH (SIO mode) 0 Serial transfer operating status monitor 0: Terminated 1: In process
(Prohibit RMW)
93CS44-210
2004-02-10
TMP93CS44/S45
Serial bus interface control (2/2)
Symbol Name Address 7 6 5 4 3 2 1 0
SWRST R/W 0 Software reset 0: - 1: Initialize SBI DB0
SBICR3
Serial bus interface status register 3
4FH
SBIDBR
Serial bus interface data buffer register
DB7 4CH (Prohibit RMW) SA6
DB6
DB5
DB4 DB3 R (Receive)/W (Send) Undefined
DB2
DB1
SA5 0
SA4 0
SA3 W 0
SA2 0
SA1 0
SA0 0
ALS 0
Address recognition mode 0: Enable 1: Disable
I2CAR
I2C bus address register
4DH (Prohibit RMW)
0
Slave address selection
(9) Watchdog timer
Symbol Name Address 7
WDTE 1 1: WDT enable
6
WDTP1 0 215/fSYS 217/fSYS 219/fSYS 221/fSYS
5
WDTP0 0
4
WARM
3
2
1
0
Watchdog timer mode WDMOD control register
5CH
00: 01: 10: 11:
HALTM1 HALTM0 RESCR DRVE R/W 0 0 0 0 0 Warm-up HALT mode 1: Connect 1: Drive the pin timer internally 00: RUN mode WDT out in STOP 0: 214/inputted 01: STOP mode mode to reset frequency 10: IDLE1 mode pin 1: 216/ inputted 11: IDLE2 mode
frequency
WDCR
Watchdog timer control register
5DH B1H: WDT disable code
- W - 4EH: WDT clear code
93CS44-211
2004-02-10
TMP93CS44/S45
(10) AD converter control
Symbol Name Address 7
EOCF R ADMOD 0 AD mode control register 0 5EH 0 1: End 0 1: Busy 0 Always write "0". 0 Always write "0".
6
AD8F
5
-
4
-
3
ITM0
2
REPET
1
SCAN
0
ADS
ADMOD 1
AD mode control register 1
5FH
VREFON R/W 1 0: OFF 1: ON
R/W 0 0 0 0 0: Every 0: Single 0: fixed1: START conversion 1: Repeat channel 1: Every 1: Scan four conversion ADTRGE ADCH2 ADCH1 ADCH0 R/W 0 0 0 0
External trigger start control 0: Disable 1: Enable
Analog input channel selection ADR0RF R 0
Conversion result stored flag
AD conversion AD result REG04L register 0/4 low
*1)
ADR01 60H
ADR00
AD conversion AD result REG04H register 0/4 high AD conversion AD result REG15L register 1/5 low
*1)
R Undefined Stores lower two bits of AD conversion result ADR09 ADR08
ADR07
ADR06
ADR05
ADR04
ADR03
ADR02
61H
R Undefined Stores upper eight bits of AD conversion result ADR11 ADR10 R Undefined Stores lower two bits of AD conversion result ADR19 ADR18 ADR1RF R 0
Conversion result stored flag
62H
AD conversion AD result REG15H register 1/5 high AD conversion AD result REG26L register 2/6 low
*1)
ADR17
ADR16
ADR15
ADR14
ADR13
ADR12
63H
R Undefined Stores upper eight bits of AD conversion result ADR20 R Undefined Stores lower two bits of AD conversion result ADR29 ADR28 ADR21 ADR2RF R 0
Conversion result stored flag
64H
AD conversion AD result REG26H register 2/6 high AD conversion AD result REG37L register 3/7 low
*1)
ADR27
ADR26
ADR25
ADR24
ADR23
ADR22
65H
R Undefined Stores upper eight bits of AD conversion result ADR31 ADR30 R Undefined Stores lower two bits of AD conversion result ADR39 ADR38 ADR35 ADR34 R Undefined Stores upper eight bits of AD conversion result 9 8 7 6 5 4 3 2 1 0 ADR37 ADR36 ADR33 ADR3RF R 0
Conversion result stored flag
66H
AD REG37H
AD conversion result register 3/7 high
ADR32
67H
Converted data of channel x *1: Data to be stored in AD conversion result register low are the lower 2 bits of the conversion result. The contents of the 5 to 1 bits of this register are always read as 1. Bit0 conversion result stored flag bit , is set to 1 when the AD conversion result is stored. Reading either the ADREGxH or the ADREGxL registers clears to 0.
7
6
5
4
3
2
1
0
7
6
5
4
ADREGxL 321
0
ADREGxH
This is "1" when this is read.
93CS44-212
2004-02-10
TMP93CS44/S45
6.
Port Section Equivalent Circuit Diagram
* Reading the circuit diagram Basically, the gate symbols written are the same as those used for the standard CMOS logic IC [74HCXX] series. The dedicated signal is described below. STOP: This signal becomes active 1 when the HALT mode setting register is set to the STOP mode (WDMOD = 0, 1) and the CPU executes the HALT instruction. When the drive enable bit WDMOD is set to 1, however, STOP remains at 0.
*
The input protection resistance ranges from several tens of ohms to several hundreds of ohms.
P0 (AD0 to AD7), P1 (AD8 to AD15/A8 to A15), P4 and P7
VCC Output data P-ch
Output enable STOP N-ch
Input data
I/O
Input enable
P2 (A16 to A23/A0 to A7), P32, P61, P62, P64 and P65
VCC Output data P-ch
Output enable STOP N-ch
VCC
Programmable pull-up resistor
P-ch I/O
Input data
Input enable
93CS44-213
2004-02-10
TMP93CS44/S45
P30 ( RD ) and P31 ( WR )
VCC Output data P-ch OUT N-ch
STOP
P33 (SO/SDA) and P34 (SI/SCL)
VCC Output data P-ch
Open-drain output enable STOP Input data
N-ch
I/O
Input enable
P35 (INT0)
VCC Output data P-ch
Output enable STOP N-ch
Input data Interrupt request signal Schmitt
I/O
P50 to P52 (AN0 to AN2), P54 to P57 (AN4 to AN7)
Analog input channel select Analog input N-ch Input data
P-ch Input
Input enable
93CS44-214
2004-02-10
TMP93CS44/S45
P53 (AN3 / ADTRG )
Analog input channel select Analog input N-ch Input data
P-ch Input
Input enable AD trigger STOP
P60 (TXD0) and P63 (TXD1)
VCC Output data P-ch
Open-drain output enable STOP
VCC N-ch P-ch
Programmable pull-up resistor
Input data
I/O
Input enable
P66 (XT1) and P67 (XT2)
Input enable
Clock
Input data Output data output enable N-ch Input enable
Oscillator P67 (XT2) N-ch P-ch
Input data Output data output enable P66 (XT1) N-ch
STOP Low-frequency oscillation enable
93CS44-215
2004-02-10
TMP93CS44/S45
NMI
NMI Schmitt Input
CLK
Output enable Internal CLK P-ch P-ch OUT N-ch STOP VCC VCC
Internal reset Test circuit
Input enable
EA
Input data Input
AM8/ AM16
Input data Input
ALE
VCC Internal ALE P-ch OUT Output enable N-ch
93CS44-216
2004-02-10
TMP93CS44/S45
RESET
VCC
Internal reset WDTOUT Reset enable Schmitt
Input
X1 and X2
Clock Oscillator X2 P-ch High-frequency oscillation enable X1 N-ch
VREFH and VREFL
VREFON P-ch VREFH
String resistance VREFL
93CS44-217
2004-02-10
TMP93CS44/S45
7.
Points of Note and Restriction
(1) Notation 1. 2. Explanation of a built-in I/O register: Register symbol Example: TRUN ... Bit T0RUN of register TRUN Read-modify-write instruction An instruction in which the CPU executes following by one instruction. 1. 2. 3. CPU reads data of the memory. CPU modifies the data. CPU writes the data to the same memory. Example 1: SET 3, (TRUN) ... Set bit3 of TRUN Example 2: INC 1, (100H) ... Increment the data of 100H A sample read-modify-write instructions using the TLCS-900 Exchange EX (mem), R Arithmetic operation ADD (mem), R/# SUB (mem), R/# INC #3, (mem) Logical operation AND (mem), R/# XOR (mem), R/# Bit manipulation STCF #3/A, (mem) RES #3, (mem) CHG #3, (mem) Rotate and shift RLC (mem) RL (mem) SLA (mem) SLL (mem) RLD (mem) fc, fs, fFPH, fSYS, 1 state ADC SBC DEC OR (mem), R/# (mem), R/# #3, (mem) (mem), R/#
*
SET #3, (mem) TSET #3, (mem)
RRC RR SRA SRL RRD
(mem) (mem) (mem) (mem) (mem)
3.
The clock frequency input from pins X1 and X2 pin is called fc, and the clock frequency input from XT1, XT2 pin is called fs. The clock frequency selected by SYSCR1is called system clock fFPH, and the clock frequency given by fFPH divided by 2 is called fSYS. One cycle of fSYS is called 1 state.
93CS44-218
2004-02-10
TMP93CS44/S45
(2) Care points 1. The operation voltage The operation voltage of TMP93PW44A is VCC = 4.5 to 5.5 V though the operation voltage of TMP93CS44/45, TMP93PS44, TMP93CU44, and TMP93CW44 is VCC = 2.7 to 5.5V. Especially, be careful when TMP93CU44, TMP93CW44, and TMP93PW44A are used. Please refer to the section 4 "Electric Characteristic" for details of each product. 2. 3. 4.
EA , AM8/ AM16 pin
Fix these pins VCC or VSS unless changing voltage. TEST1, TEST2 pin Connect TEST1 pin with TEST2 pin. HALT mode (IDLE1) When IDLE1 mode (Oscillator operation only) is used, set TRUN to 0 to stop prescaler before "HALT" instruction is executed. 5. Warm-up counter The warm-up counter operates when STOP mode is released even if the system is using an external oscillator. As a result, it takes warm-up time from inputting the releasing request to outputting the system clock. 6. Programmable pull-up resistor The programmable pull-up resistors can be turned ON/OFF by the program when the ports are used as input ports. When the ports are used as the output ports, they can not be selected ON/OFF by the program. The data registers (e.g., P6 register) are used for the pull-up resistors ON/OFF. Consequently, read-modify-write instructions are prohibited. 7. Watchdog timer The watchdog timer starts operation immediately after the reset is released. When the watchdog timer is not used, disable it. 8. AD Converter The string register between VREFH and VREFL pins can be cut by a program to reduce power consumption. When the standby mode is used, disable the resistor using the program before the "HALT" instruction is executed. 9. CPU (Micro DMA) Only the "LDC cr, r", "LDC r, cr" instructions can be used to access the control registers in the CPU (like the transfer source address register (DMASn)). 10. POP SR instruction Please execute POP SR instruction during DI condition. 11. Releasing the HALT mode by requesting an interruption Usually, interrupts can release all halts status. However, the interrupts = ( NMI , INT0) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (RUN and IDLE2 are not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt are generated after it has shifted to HALT mode completely, halt status can be released without difficultly. The priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
93CS44-219
2004-02-10
8.
ITEM
64-Kbyte mask ROM (FF0000H to FFFFFFH) None 2 Kbytes (80H to 87FH) 3 Kbytes (80H to C7FH) 64-Kbyte 96-Kbyte OTP mask ROM (FF0000H to FFFFFFH) (FE8000H to FFFFFFH) 128-Kbyte mask ROM (FE0000H to FFFFFFH)
TMP93CS44
TMP93CS45
TMP93PS44
TMP93CU44
TMP93CW44
TMP93PW44A
128-Kbyte OTP (FE0000H to FFFFFFH)
Built-in ROM
Built-in ROM
4 Kbytes (80H to 107FH)
CS1 Mapping Area (WAITC1 = 00) 880H to 7FFFH C80H to 7FFFH
1080H to 7FFFH
TMP93XX44/45 Different Points
CS2 Mapping Area (WAITC2 = 11) C00000H to FEFFFFH C00000H to FFFFFFH C00000H to FE7FFFH C00000H to FEFFFFH
C00000H to FDFFFFH
93CS44-220
2.7 to 5.5 V P-LQFP80-1212-0.50E
Operation Voltage
4.5 to 5.5 V
Package
P-QFP80-1420-0.80B
TMP93CS44/S45
2004-02-10
TMP93CS44/S45
9. Package Dimensions
P-LQFP80-1212-0.50E Unit: mm
60 61
41 40
80 20 1.25 TYP. 0.5
21
0.22 0.05
0.08
93CS44-221
2004-02-10
TMP93CS44/S45
93CS44-222
2004-02-10


▲Up To Search▲   

 
Price & Availability of TMP93CS44

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X